Open oshyshko opened 6 years ago
The user could write: ,/cmdargs.hs -u joe -- ls -l
, which would take advantage of the fact that --
separates arguments from flags.
But currently there is no way to get that behaviour from cmdargs
- although it was requested once before, so seems a plausible addition.
Yep, I have wanted this for years for hledger, which sometimes invokes separate executables with their own flags. Everybody trips up on the need for -- in this case. http://hledger.org/manual.html#command-options
I am working on a program that has
sudo
-like interface:Here's my current code:
It works fine for commands without flags or when
--
is used to mark the end of flags.However, it doesn't work when a sub-command has flags and when
--
is not used:Q: How to instruct
cmdargs
to not look for flags in the remaining arguments?