-
Notifications
You must be signed in to change notification settings - Fork 57
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
it would be a great idea if you pass a file as parameter... #11
Comments
Hi, my first go was to avoid making argument parsing complicated. I wanted to avoid all the hassle. I know that there are marvelous library existing to parse the command line, and maybe I should go to choose one of them now. Thou, I'm curious of which case you couldn't use pipes. I can't realy see an example. And pipes are often much more agile to use. You don't have to work on files. And writing temporary files is cumbersome. Anyway, I think your request is valid, and that I may not work on it myself now, as I don't have many time, and I consider this as a new feature, and not something really impeding the use of |
Here's a use-case that pipes makes pretty hard: using find, xargs, and shyaml. With a command-line file input, this is easy:
but with the pipe requirement, you have to do something like
which doesn't work, because the pipe syntax is ambiguous. |
I would suggest using:
Anyway, I'm still in favor to add a command line argument to |
Use custom argparse Action (FileInputAction) to open given file (or stdin if file is "-" or not given). Update usage and help messages and README examples. Issue 0k#11
Pipes are great but not always handy and in certain ways, shouldn't truly be necessary if instead a "file.open" was used.
The text was updated successfully, but these errors were encountered: