Skip to content

Include manpages for lima and limactl commands #1521

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 14, 2023

Conversation

afbjorklund
Copy link
Member

@afbjorklund afbjorklund commented May 2, 2023

The "limactl.1" and subcommands are being dynamically generated.

There is one manual page for each subcommand, e.g. limactl-start


https://github.com/spf13/cobra/blob/main/doc/man_docs.md

There is also help2man --no-info, for individual commands

@AkihiroSuda AkihiroSuda added the documentation Improvements or additions to documentation label May 2, 2023
@afbjorklund
Copy link
Member Author

Here is the lima.1, in markdown:

LIMA 1 "May 2023" "" ""
=======================

# NAME
lima - Lima: Linux virtual machines

# SYNOPSIS
**lima** [_COMMAND_...]

# DESCRIPTION
lima is an alias for "limactl shell default".
The instance name ("default") can be changed by specifying $LIMA\_INSTANCE.

The shell and initial workdir inside the instance can be specified via $LIMA\_SHELL
and $LIMA\_WORKDIR.

# SEE ALSO
**limactl**(1)

@AkihiroSuda
Copy link
Member

CI is failing

_output/bin/limactl generate-man _output/share/man/man1
time="2023-05-03T07:06:14Z" level=fatal msg="must not run as the root"

We can just allow generate-man for root

The "limactl.1" and subcommands are being dynamically generated.

There is one manual page for each subcommand, e.g. limactl-start

Signed-off-by: Anders F Björklund <[email protected]>
@AkihiroSuda AkihiroSuda added this to the v0.16.0 milestone May 11, 2023
Copy link
Member

@AkihiroSuda AkihiroSuda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

Copy link
Member

@jandubois jandubois left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PR seems fine.

The auto-generated man pages look a bit sparse (I just compared man limactl-start with man git-commit and man kubectl-get). I guess it would be a matter of improving the Cobra definitions for each command.

I also noticed that git commit --help will invoke man git-commit, which has better formatting than what Cobra does. I wonder if this is something we should consider (fwiw, kubectl doesn't delegate to man).

@afbjorklund
Copy link
Member Author

afbjorklund commented May 11, 2023

I think we should just use the default cobra output, and improve the descriptions in the code if it is needed.

We could also generate markdown, and use that for a standalone documentation - like in a docs web site

https://github.com/spf13/cobra/blob/main/doc/md_docs.md

@jandubois
Copy link
Member

I think we should just use the default cobra output, and improve the descriptions in the code if it is needed.

That's what I meant by "improving the Cobra definitions". Having separate (duplicate) docs for each subcommands is just not maintainable.

@afbjorklund
Copy link
Member Author

I did some experiments with generating markdown and html, from cobra:

master...afbjorklund:lima:markdown

limactl-docs-blackfriday-html

It's not perfect, since most of it is just blocks of performatted text (at best)

@AkihiroSuda AkihiroSuda merged commit e57ac78 into lima-vm:master May 14, 2023
@afbjorklund afbjorklund mentioned this pull request Sep 4, 2023
8 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation impact/changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants