Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to run a command that has subcommands? #103

Open
OnkelTem opened this issue Aug 4, 2024 · 1 comment
Open

How to run a command that has subcommands? #103

OnkelTem opened this issue Aug 4, 2024 · 1 comment

Comments

@OnkelTem
Copy link

OnkelTem commented Aug 4, 2024

From the docs:

Commands can also have subcommands, which are added with addSubcommand. A command with subcommands can't run its own code, so run doesn't need to be implemented.

Consider an example:

$ ip route
<prints routes>

$ ip route add ...
<adds a route>

$ ip route del ...
<removes a route>

So I cannot implement a similar CLI with the args package?

@mosuem mosuem transferred this issue from dart-archive/args Oct 14, 2024
@lrhn lrhn changed the title How to run a command that has subcommands? [args] How to run a command that has subcommands? Nov 11, 2024
@lrhn
Copy link
Member

lrhn commented Nov 11, 2024

Not sure what the question is.

Nothing in your example looks wrong.
What you cannot do it to have

ip

itself do anything but list its subcommands

@lrhn lrhn changed the title [args] How to run a command that has subcommands? How to run a command that has subcommands? Nov 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants