mpeterv / argparse

Feature-rich command line parser for Lua
MIT License
251 stars 43 forks source link

Add ability to add arguments to a mutex #11

Closed RyanSquared closed 6 years ago

RyanSquared commented 7 years ago

Kinda like how Python runs stuff, I would like to be able to do fusion [ --package <package> | file ] so that either you can run fusion --package <package> or fusion <file>.

mpeterv commented 7 years ago

Makes sense to implement this. Need to think a bit about the way this affects usage message. As order is important for positional arguments it would make sense to put usage of a mutex containing an argument in the spot where argument's usage would be if it wasn't in a mutex. Like this:

cmd [--option1] [--option2] <arg1> ([--option3] | <arg2>) <arg3>

I'll see if I can implement this, in the meantime pull requests are welcome.

mpeterv commented 6 years ago

Implemented on master branch (better late than never...)