2to3: New completion.

master
Ville Skyttä 2013-07-21 13:28:23 +03:00
parent 42196ef7fc
commit a4b69e7587
4 changed files with 60 additions and 1 deletions

39
completions/2to3 Normal file
View File

@ -0,0 +1,39 @@
# bash completion for 2to3 -*- shell-script -*-
_2to3()
{
local cur prev words cword split
_init_completion -s || return
case $prev in
-h|--help|--add-suffix)
return
;;
-f|--fix|-x|--nofix)
COMPREPLY=( $( compgen -W \
"$( $1 --list-fixes 2>/dev/null | sed -e 1d )" -- "$cur" ) )
return
;;
-j|--processes)
COMPREPLY=( $( compgen -W "{1..$(_ncpus)}" -- "$cur" ) )
return
;;
-o|--output-dir)
_filedir -d
return
;;
esac
$split && return
if [[ $cur == -* ]]; then
COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) )
[[ $COMPREPLY == *= ]] && compopt -o nospace
return
fi
_filedir py
} &&
complete -F _2to3 2to3
# ex: ts=4 sw=4 et filetype=sh

View File

@ -1,5 +1,6 @@
bashcompdir = $(pkgdatadir)/completions
bashcomp_DATA = 7z \
bashcomp_DATA = 2to3 \
7z \
a2x \
abook \
aclocal \

1
test/completion/2to3.exp Normal file
View File

@ -0,0 +1 @@
assert_source_completions 2to3

View File

@ -0,0 +1,18 @@
proc setup {} {
save_env
}
proc teardown {} {
assert_env_unmodified
}
setup
assert_complete_any "2to3 "
sync_after_int
teardown