adamabdelhamed / PowerArgs

The ultimate .NET Standard command line argument parser
MIT License
569 stars 56 forks source link

Add subjects that actions can be performed on #124

Open philippgille opened 6 years ago

philippgille commented 6 years ago

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

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

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 commented 6 years ago

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

philippgille commented 6 years ago

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?