Change read to use -s/--silent and -S/--shell

Closes #4490
This commit is contained in:
Mahmoud Al-Qudsi 2018-03-09 11:48:09 -06:00
parent b38ac1e35d
commit db8ec59ac4

View file

@ -62,10 +62,10 @@ static const struct woption long_options[] = {{L"export", no_argument, NULL, 'x'
{L"right-prompt", required_argument, NULL, 'R'}, {L"right-prompt", required_argument, NULL, 'R'},
{L"command", required_argument, NULL, 'c'}, {L"command", required_argument, NULL, 'c'},
{L"mode-name", required_argument, NULL, 'm'}, {L"mode-name", required_argument, NULL, 'm'},
{L"silent", no_argument, NULL, 'i'}, {L"silent", no_argument, NULL, 's'},
{L"nchars", required_argument, NULL, 'n'}, {L"nchars", required_argument, NULL, 'n'},
{L"delimiter", required_argument, NULL, 'd'}, {L"delimiter", required_argument, NULL, 'd'},
{L"shell", no_argument, NULL, 's'}, {L"shell", no_argument, NULL, 'S'},
{L"array", no_argument, NULL, 'a'}, {L"array", no_argument, NULL, 'a'},
{L"null", no_argument, NULL, 'z'}, {L"null", no_argument, NULL, 'z'},
{L"help", no_argument, NULL, 'h'}, {L"help", no_argument, NULL, 'h'},
@ -148,15 +148,15 @@ static int parse_cmd_opts(read_cmd_opts_t &opts, int *optind, //!OCLINT(high nc
break; break;
} }
case 's': { case 's': {
opts.shell = true; opts.silent = true;
break; break;
} }
case 'a': { case 'a': {
opts.array = true; opts.array = true;
break; break;
} }
case L'i': { case L'S': {
opts.silent = true; opts.shell = true;
break; break;
} }
case L'z': { case L'z': {