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

Store unknown flags #36

Open
ndmitchell opened this issue Aug 18, 2015 · 2 comments
Open

Store unknown flags #36

ndmitchell opened this issue Aug 18, 2015 · 2 comments

Comments

@ndmitchell
Copy link
Owner

From https://code.google.com/p/ndmitchell/issues/detail?id=470:

Some programs want to accumulate "unknown" flags, i.e. those which aren't otherwise recognised by the program. I'm in two minds about this, since it brings a number of disadvantages:

  1. There will be no --help output for these commands, so they are undiscoverable.
  2. Given a known flag --bar, then --ba will automatically resolve to --bar, unless there is also a --baa in which case it will be an ambiguous error. The existence or otherwise of commands changes the parser, so having unknown flags can be problematic.

On the other hand, it's something that hledger already does with the -- option, so supporting it more explicitly might give a better experience for them. See this thread for details: http://www.mail-archive.com/[email protected]/msg92770.html

@simonmichael says:

Yes, without this (optional) feature it seems hard to pass extra flags through to be handled by a sub-executable. Here's an example: hledger wants to pass some web-specific options through to hledger-web as in https://code.google.com/p/hledger/issues/detail?id=64 .

Not quite so hard as all that: http://joyful.com/darcsden/simon/hledger/patch/20110923141027-3c3f9 . But it would still be nice not to have to type --.

@LeventErkok
Copy link

@ndmitchell Is there any update on this? It would be nice if the program gets access to "unknown flags" instead of cmdargs just throwing an error for better error reporting and integration with, say, editors.

@ndmitchell
Copy link
Owner Author

@LeventErkok no update, and I don't expect there to be one in the near future. Would still be nice to have, if someone wants to submit a patch.

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

No branches or pull requests

2 participants