Re: Nested calls to getopts incorrectly parses clustered options

2015-01-14 Thread Chet Ramey
On 1/14/15 5:35 AM, Øyvind 'bolt' Hvidsten wrote: > Nobody else having issues with this? > It's still a case in bash 4.3.30 There is a change in the devel branch that makes local copies of OPTIND behave as you expect. -- ``The lyf so short, the craft so long to lerne.'' - Chaucer

Re: Nested calls to getopts incorrectly parses clustered options

2015-01-14 Thread Pierre Gaston
On Wed, Jan 14, 2015 at 12:35 PM, Øyvind 'bolt' Hvidsten wrote: > Nobody else having issues with this? > It's still a case in bash 4.3.30 > > > On 31/05/14 18:40, Øyvind Hvidsten wrote: > >> For a simple test: >> >> $ f() { local OPTIND=1 OPTARG OPTERR opt; while getopts ":abcxyz" opt; >> do echo

Re: Nested calls to getopts incorrectly parses clustered options

2015-01-14 Thread Øyvind 'bolt' Hvidsten
Nobody else having issues with this? It's still a case in bash 4.3.30 On 31/05/14 18:40, Øyvind Hvidsten wrote: For a simple test: $ f() { local OPTIND=1 OPTARG OPTERR opt; while getopts ":abcxyz" opt; do echo "opt: $opt"; if [[ "$opt" = "y" ]]; then f -a -b -c; fi; done; }; f -x -y -z opt: x o

Nested calls to getopts incorrectly parses clustered options

2014-05-31 Thread Øyvind Hvidsten
For a simple test: $ f() { local OPTIND=1 OPTARG OPTERR opt; while getopts ":abcxyz" opt; do echo "opt: $opt"; if [[ "$opt" = "y" ]]; then f -a -b -c; fi; done; }; f -x -y -z opt: x opt: y opt: a opt: b opt: c opt: z However, if the options are clustered: $ f() { local OPTIND=1 OPTARG OPTERR