handle the "-s" command line option that POSIX requires
This commit is contained in:
parent
a71cfa8aa1
commit
19a7ea126a
@ -4238,7 +4238,8 @@ int hush_main(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
input = stdin;
|
input = stdin;
|
||||||
|
|
||||||
while ((opt = getopt(argc, argv, "c:xin")) > 0) {
|
/* http://www.opengroup.org/onlinepubs/9699919799/utilities/sh.html */
|
||||||
|
while ((opt = getopt(argc, argv, "c:xins")) > 0) {
|
||||||
switch (opt) {
|
switch (opt) {
|
||||||
case 'c':
|
case 'c':
|
||||||
G.global_argv = argv + optind;
|
G.global_argv = argv + optind;
|
||||||
@ -4258,6 +4259,10 @@ int hush_main(int argc, char **argv)
|
|||||||
case 'n':
|
case 'n':
|
||||||
G.fake_mode = 1;
|
G.fake_mode = 1;
|
||||||
break;
|
break;
|
||||||
|
case 's':
|
||||||
|
/* "-s" means "read from stdin", but this is how we always
|
||||||
|
* operate, so simply do nothing here. */
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
#ifndef BB_VER
|
#ifndef BB_VER
|
||||||
fprintf(stderr, "Usage: sh [FILE]...\n"
|
fprintf(stderr, "Usage: sh [FILE]...\n"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user