-
-
Notifications
You must be signed in to change notification settings - Fork 102
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
Hyphen to indicate take input from os.Stdin #260
Comments
I use this convention quite often in programs I write using go-arg too. I've found it's best to implement at the level of the application using the library, rather than right within the library. I often have a string argument that is used as a filename, with a special case for when it's set to "-". Is this what you mean? Or is it that you would read lines from standard input to populate an argument? |
I don't mean a file named "-". I mean, one input source is standard input (rather than a named file). Stdin could be coming from a pipe. Stdin could be coming from interactive typing (or pasting). For example,
HTH! |
I also think it would be better to handle such cases on application level instead of hard-coding
|
It is a Unix convention that a hyphen as a command line argument instructs a program to take input from standard input rather than from a named file.
Would it be possible to implement this ?
It certainly comes in handy when using a program with a pipe, or when pasting input.
The text was updated successfully, but these errors were encountered: