Cobra: Question: Generating one man page for all commands

Created on 15 Mar 2017  路  5Comments  路  Source: spf13/cobra

Can cobra generate a single manpage with all your commands? And what would be the best way to do it if not?

kinenhancement

Most helpful comment

That code snippet generates a man file for each of the commands in my application. Like in most other applications I want the command, to generate just one file for the entire set of commands, like in git and such.

The command I use when I follow the code snippet from @1138-4EB is the applications rootCmd.

All 5 comments

That code snippet generates a man file for each of the commands in my application. Like in most other applications I want the command, to generate just one file for the entire set of commands, like in git and such.

The command I use when I follow the code snippet from @1138-4EB is the applications rootCmd.

@groenborg Hmmm, for me git has a separate man page for every command. Is it not that way for you?

@justinclift my bad, it missed an essential part of using man pages.. You have to use a dash between the git subcommands to get their man pages, I did not realize that

thanks for the answers

Was this page helpful?
0 / 5 - 0 ratings

Related issues

supershal picture supershal  路  4Comments

rogercoll picture rogercoll  路  5Comments

jjzcru picture jjzcru  路  3Comments

umbynos picture umbynos  路  5Comments

garthk picture garthk  路  3Comments