Skip to content

Using typer in verb-noun vs noun-verb (with 3+... layers? to it) #697

Answered by pmav99
gwinans asked this question in Questions
Discussion options

You must be logged in to vote

The tutorial has information for nested subcommands: https://typer.tiangolo.com/tutorial/subcommands/nested-subcommands/
Unless there is some bug, it shouldn't be too difficult to extend it to more levels.

That being said, from a code point of view it might be simpler to just go with:

proxysqlctl get admin-users
proxysqlctl get admin-variables
proxysqlctl get mysql-servers
proxysqlctl get mysql-users
proxysqlctl get mysql-variables
...

Furthermore, fewer nested levels would probably make it easier for users to discover the available subcommands, too.

With additional levels you need to do issue extra commands:

proxysql get --help              # Ah! there is a mysql sub-subcommand
proxysql…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@gwinans
Comment options

Answer selected by gwinans
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Question or problem
2 participants