[PATCH] initial word completion: fix completion of prefix

2018-11-09 Thread Luca Boccassi
If the user types: gcfile.c And positions the cursor of 'f', a programmable completion enabled on initial word (-I) will fail to run. This is because the parsing gives priority first to the _minimal programmable completion that does nothing, and then if that is disabled it gives the next priority

Re: exiting noninteractive shells on 'shift 2'

2018-11-09 Thread Chet Ramey
On 11/9/18 11:46 AM, Eric Blake wrote: > On 11/9/18 10:42 AM, Chet Ramey wrote: > >> >>> A diagnostic message shall be written to standard error whenever an >>> error condition occurs." >>> >>> Since 'shift 2' when $# is 1 is an error, and results in non-zero status, >>> it should print a dia

Re: exiting noninteractive shells on 'shift 2'

2018-11-09 Thread Eric Blake
On 11/9/18 10:42 AM, Chet Ramey wrote:     A diagnostic message shall be written to standard error whenever an error condition occurs." Since 'shift 2' when $# is 1 is an error, and results in non-zero status, it should print a diagnostic to stderr. So maybe the thing to do is to turn on t

Re: exiting noninteractive shells on 'shift 2'

2018-11-09 Thread Chet Ramey
On 11/9/18 11:22 AM, Eric Blake wrote: > On 11/9/18 8:52 AM, Chet Ramey wrote: >> On 11/9/18 9:47 AM, Eric Blake wrote: >> >>> Well, there's STILL a conformance issue - the standard requires that unless >>> documented otherwise, any time a command line tool exits with non-zero >>> status, that it o

Re: exiting noninteractive shells on 'shift 2'

2018-11-09 Thread Eric Blake
On 11/9/18 8:52 AM, Chet Ramey wrote: On 11/9/18 9:47 AM, Eric Blake wrote: Well, there's STILL a conformance issue - the standard requires that unless documented otherwise, any time a command line tool exits with non-zero status, that it outputs a message to stderr explaining the error. Wher

Re: exiting noninteractive shells on 'shift 2'

2018-11-09 Thread Chet Ramey
On 11/9/18 9:47 AM, Eric Blake wrote: > Well, there's STILL a conformance issue - the standard requires that unless > documented otherwise, any time a command line tool exits with non-zero > status, that it outputs a message to stderr explaining the error.  Where? -- ``The lyf so short, the cr

Re: exiting noninteractive shells on 'shift 2'

2018-11-09 Thread Eric Blake
On 11/8/18 6:03 PM, Chet Ramey wrote: On 11/8/18 3:37 PM, Eric Blake wrote: If I'm reading POSIX correctly, shift is a special built-in utility, and if '$#' is 0 or 1, then 'shift 2' counts as a utility error that shall exit the shell, per the table in 2.8.1 Consequences of Shell Errors: http:/