[Question] Why are my commands appearing as subcommands?
See original GitHub issueHello,
I’m wondering why the commands I’ve defined, appear as subcommands, instead of “main” commands.
For example, I’ve defined something like the following:
@expose(
help='some help',
aliases=['alias'],
arguments=[
(['args'], dict(action='store', nargs='*')),
]
)
def some_command(self):
pass
And, when I execute the application for showing the help, this is how appears:
usage: app [-h] [--debug] [--quiet] {some_command, alias} ...
An app
optional arguments:
-h, --help show this help message and exit
--debug toggle debug output
--quiet suppress all output
sub-commands:
{some_command, alias}
some_command (alias) some help
The command invocation works fine; it’s just that I was expecting to make the commands appear as in the quickstart.
Many thanks for your work.
Issue Analytics
- State:
- Created 7 years ago
- Comments:12 (8 by maintainers)
Top Results From Across the Web
modify sub commands?? - Autodesk Community - AutoCAD
Solved: I'm currently enrolled in an entry level AutoCAD class, and I'm having a bit of trouble answering a question on an assignment...
Read more >In Python Click how do I see --help for Subcommands whose ...
I have done something like this: class PerCommandOptWantSubCmdHelp(click.Option): def handle_parse_result(self, ctx, opts, args): # check to ...
Read more >Working with help subcommands of recent CLI tools
Asking for help, clarification, or responding to other answers. Making statements based on opinion ; back them up with references or personal ...
Read more >svn Reference—Subversion Command-Line Client
svn is the official command-line client of Subversion. Its functionality is offered via a collection of task-specific subcommands, most of which accept a ......
Read more >Commands and Groups — Click Documentation (7.x)
Click strictly separates parameters between commands and subcommands. ... Commands can also ask for the context to be passed by marking themselves with...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Add this to your controller’s Meta: stacked_on = ‘base’ stacked_type = ‘embedded’
More info here: http://builtoncement.com/2.10/dev/controllers.html#addi tional-controllers-and-namespaces
On Mon, 2017-02-20 at 09:51 -0800, Julen Pardo wrote:
@julenpardo I think I understand now. You are asking why the output of ‘–help’ is different than the QuickStart example? All of the dicumentIon currently references use of ‘CementBaseController’ which will look different. That said, You do want to use ArgparseController because it will be the standard moving forward.
If you need to customize the output of how --help looks you might want to research how it would be done with Argeparse directly… then I could help integrate that into Cement. CementBaseController is very hacky… where ArgparseController uses proper ArgparseController mechanisms for creating subcommabds via subparsers.