[Bash-completion-devel] [bash-completion-Bugs][314726] _parse_help result makes java completion fail with failglob.

bash-completion-bugs at alioth.debian.org bash-completion-bugs at alioth.debian.org
Thu Jun 12 21:18:26 UTC 2014


bash-completion-Bugs item #314726, was opened at 12/06/2014 23:18 by Dams Nadé
You can respond by visiting: 
https://alioth.debian.org/tracker/?func=detail&atid=413095&aid=314726&group_id=100114

Status: Open
Priority: 3
Submitted By: Dams Nadé (anvil-guest)
Assigned to: Nobody (None)
Summary: _parse_help result makes java completion fail with failglob.  
Distribution: None
Originally reported in: None
Milestone: None
Status: None
Original bug number: 


Initial Comment:
java -help has a funny line :
    -? -help      print this help message

This is due to the way the $(_parse_help) expansion result is assigned to the COMPREPLY array. 

The expression

array=( $(command expansion) )

makes the result the expansion being re-word-splitted and re-globbed. While that kind of expansion is *everywhere* in the bash completion, I've currently only found a problem in the java completion.

arrays should be assigned from expansion either by using combinations of loops and "read -a < <(command expansion)", or "mapfile -t < <(command expansion)"

e.g : the java case can be fixed by doing :
mapfile -t COMPREPLY < <( compgen -W '$( _parse_help "$1" -help )' -- "$cur" )

See attached patch.

Be careful with this patch though, because it will make the test suite break. See [#314720] for more details about that.

----------------------------------------------------------------------

You can respond by visiting: 
https://alioth.debian.org/tracker/?func=detail&atid=413095&aid=314726&group_id=100114



More information about the Bash-completion-devel mailing list