Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Adding Multi level commands #1355

Answered by tleonhardt
vinaynkaranth asked this question in Q&A
Discussion options

How can I achieve multi level commands (nested commands) using cmd2?

The command/subcommand hierarchy may look something like this:

show -
 module1
 counters <args>
 parameters
 module2
 configuration
 history
set 
 module1
 parameter <args>
 config <args>
You must be logged in to vote

See our subcommands.py example for how to use subcommands. I think that will give you what you want.

Replies: 1 comment

Comment options

See our subcommands.py example for how to use subcommands. I think that will give you what you want.

You must be logged in to vote
0 replies
Answer selected by tleonhardt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet

AltStyle によって変換されたページ (->オリジナル) /