Skip to content

Commit

Permalink
gphoto2: Fix split argument handing, and colon treatment in --port args
Browse files Browse the repository at this point in the history
  • Loading branch information
scop committed Nov 16, 2014
1 parent 32e6e49 commit 7d66285
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion completions/gphoto2
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
_gphoto2()
{
local cur prev words cword split
_init_completion -s || return
_init_completion -s -n : || return

case $prev in
--debug-logfile)
Expand All @@ -25,6 +25,7 @@ _gphoto2()
--port)
COMPREPLY=( $(compgen -W "$( gphoto2 --list-ports 2>/dev/null | \
tail -n +4 | awk '{ print $1 }' )" -- "$cur") )
__ltrim_colon_completions "$cur"
return 0
;;
--camera)
Expand All @@ -40,8 +41,11 @@ _gphoto2()
;;
esac

$split && return

if [[ "$cur" == -* ]]; then
COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) )
[[ $COMPREPLY == *= ]] && compopt -o nospace
return 0
fi

Expand Down

0 comments on commit 7d66285

Please sign in to comment.