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

flag parsing prevents using "-" or @FILE in conventional ways #65

Closed
insasho opened this issue Oct 5, 2015 · 2 comments
Closed

flag parsing prevents using "-" or @FILE in conventional ways #65

insasho opened this issue Oct 5, 2015 · 2 comments

Comments

@insasho
Copy link

insasho commented Oct 5, 2015

I'm a first-time Kingpin user and I love it so far!

Unix programs often allow users to specify - to read from stdin, or allow values to be read from files using @filename syntax. kingpin returns a parse error when - is passed as a positional argument, and doesn't allow a curl-style use of @- because the @ anywhere on the command line appears to read command line arguments from a file.

The currently implemented behavior is just different enough from expectations to have caused me grief.

Feature requests:

  • Allow flags and positional arguments to receive strings prefixed with @ as arguments, as opposed to loading command line flags. For example, if I'm writing a key-value store, it should allow ./main put key @valuefile.txt to store the contents of valuefile.txt rather than have its contents treated as a command line.
  • Refine parser to not treat a single - as the beginning of a command line flag.

Thanks!

@alecthomas
Copy link
Owner

These both seem reasonable to me.

Fixing @ has been on my radar for a while. I think something like app.FlagsFile(bool) could work.

@alecthomas alecthomas mentioned this issue Dec 14, 2015
28 tasks
@alecthomas
Copy link
Owner

Closing this. It's not fixed, but I'm moving it over to #90.

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