read: add --list as synonym for --array

Work on #5846.
This commit is contained in:
David Adam 2019-08-22 21:23:06 +08:00
parent e3eb8f758b
commit 225b1204d6
3 changed files with 4 additions and 3 deletions

View File

@ -43,7 +43,7 @@ The following options are available:
- ``-x`` or ``--export`` exports the variables to child processes.
- ``-a`` or ``--array`` stores the result as a list in a single variable.
- ``-a`` or ``--list`` stores the result as a list in a single variable. This option is also available as ``--array`` for backwards compatibility.
- ``-z`` or ``--null`` marks the end of the line with the NUL character, instead of newline. This also
disables interactive mode.

View File

@ -62,6 +62,7 @@ static const struct woption long_options[] = {{L"array", no_argument, NULL, 'a'}
{L"global", no_argument, NULL, 'g'},
{L"help", no_argument, NULL, 'h'},
{L"line", no_argument, NULL, 'L'},
{L"list", no_argument, NULL, 'a'},
{L"local", no_argument, NULL, 'l'},
{L"nchars", required_argument, NULL, 'n'},
{L"null", no_argument, NULL, 'z'},

View File

@ -10,8 +10,8 @@ read
logmsg Read with -a and anything other than exactly on var name is an error
read -a
read -a v1 v2
read -a v1
read --array v1 v2
read --list v1
logmsg Verify correct behavior of subcommands and splitting of input.
begin