alecthomas / kingpin

CONTRIBUTIONS ONLY: A Go (golang) command line and flag parser
MIT License
3.5k stars 273 forks source link

Don't show the subcommands in the help output #295

Closed niks3089 closed 5 years ago

niks3089 commented 5 years ago

I have 10 commands and 20 subcommands under each of them. When the user does <myprogram --help>, he is shown the entire output of around 200 lines. I would like to show him just 10 lines of main commands. He can then do <myprogram command --help> to see the 20 other commands. Is this possible?

alecthomas commented 5 years ago

See https://github.com/alecthomas/kingpin#custom-help

There are a couple of default templates, but you can write your own.

niks3089 commented 5 years ago

Thanks will try it out. Also is there a way to limit the output of help to fit to a screen and allow further scrolling if it exceeds?

alecthomas commented 5 years ago

That is beyond the scope of Kingpin in my view.