Spiros Bousbouras
2023-08-13 13:55:43 UTC
[ Followup-To: comp.unix.programmer ]
On Sun, 13 Aug 2023 06:42:17 -0700 (PDT)
from stdin .
name arguments , a single dash among those means "read from stdin".
On Sun, 13 Aug 2023 06:42:17 -0700 (PDT)
On Unix-lke systems, what is the convention for putting a program into a
mode where it accepts input from stdin?
Where the user invokes it directly, he'll normally want input from a file. So
the normal invocation would be
myprogram myinput.txt
But if he just types "myprogram" it should display brief help text. So we
can't omit the filename to make the program read from stdin.
I would use a -h option for help text and with no arguments it should readmode where it accepts input from stdin?
Where the user invokes it directly, he'll normally want input from a file. So
the normal invocation would be
myprogram myinput.txt
But if he just types "myprogram" it should display brief help text. So we
can't omit the filename to make the program read from stdin.
from stdin .
So do you pass an option
myprogram -stdin
or what is the normal way of solving this?
- (a single dash) as argument. Even if the programme accepts multiple filemyprogram -stdin
or what is the normal way of solving this?
name arguments , a single dash among those means "read from stdin".
--
vlaho.ninja/prog
vlaho.ninja/prog