Skip to content

Commit

Permalink
fix bash completion
Browse files Browse the repository at this point in the history
  • Loading branch information
squell committed Dec 31, 2015
1 parent eb777c6 commit 9c59dc4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions bash/complete
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ _id3mtag() {
break
fi
done
if [ $n = $COMP_CWORD -a "${cur::2}" = "--" ]; then
if [ $n -eq $COMP_CWORD -a "${cur::2}" = "--" ]; then
# generate options from --help
COMPREPLY=( $( compgen -W "$(${COMP_WORDS[0]} --help | grep -oe '--[-=a-zA-Z]\+' | sed '/TYPE/{p;s///}' )" -- "$cur" ) )
elif [ $n -le $COMP_CWORD ] || [ $((n-1)) = $COMP_CORD -a "$prev" = "-D" -o "$arg" = "--duplicate" ]; then
COMPREPLY=( $( compgen -W "$(${COMP_WORDS[0]} --help | grep -oe '--[-=a-zA-Z]\+' | sed '/TYPE/{p;s///;}' )" -- "$cur" ) )
elif [ $n -le $COMP_CWORD ] || [ $((n-1)) -eq $COMP_CWORD -a \( "$prev" = "-D" -o "$arg" = "--duplicate" \) ]; then
# generate quoted filenames
COMPREPLY=( $( compgen -f -X '!*.mp3' -- "$cur" | sed '/[^[:alnum:]./]/s/.*/"&"/' ) )
fi
Expand Down

0 comments on commit 9c59dc4

Please sign in to comment.