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

Add subjects that actions can be performed on #124

Open
philippgille opened this issue Dec 2, 2017 · 2 comments
Open

Add subjects that actions can be performed on #124

philippgille opened this issue Dec 2, 2017 · 2 comments
Labels

Comments

@philippgille
Copy link

philippgille commented Dec 2, 2017

As I understand the documentation, with PowerArgs you can currently implement these two kinds of CLI:

  • myApp -some "arg"
  • myApp someAction -some "arg"

But some CLIs have another "level", which is subjects. For example the Docker CLI:

  • docker container ls -a
  • docker image ls -a
  • docker container run --name some-redis -d redis

Where docker is the application, container / image the subject and ls / run etc. the action, with actions belonging to the subject and with arguments only applying to the specific action.

Is this possible with PowerArgs? If not, I think this might be a powerful addition for complex CLIs.

@adamabdelhamed
Copy link
Owner

Yes you can. See the calculator example on the main readme of the project.

@philippgille
Copy link
Author

The usage example for the calculator example is Calculator.exe add -Value1 1 -Value2 5, which is app action -param, not app subject action -param. Or did I misunderstand the example?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants