2to3: New completion.
This commit is contained in:
parent
42196ef7fc
commit
a4b69e7587
39
completions/2to3
Normal file
39
completions/2to3
Normal 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
|
@ -1,5 +1,6 @@
|
|||||||
bashcompdir = $(pkgdatadir)/completions
|
bashcompdir = $(pkgdatadir)/completions
|
||||||
bashcomp_DATA = 7z \
|
bashcomp_DATA = 2to3 \
|
||||||
|
7z \
|
||||||
a2x \
|
a2x \
|
||||||
abook \
|
abook \
|
||||||
aclocal \
|
aclocal \
|
||||||
|
1
test/completion/2to3.exp
Normal file
1
test/completion/2to3.exp
Normal file
@ -0,0 +1 @@
|
|||||||
|
assert_source_completions 2to3
|
18
test/lib/completions/2to3.exp
Normal file
18
test/lib/completions/2to3.exp
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
proc setup {} {
|
||||||
|
save_env
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
proc teardown {} {
|
||||||
|
assert_env_unmodified
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
setup
|
||||||
|
|
||||||
|
|
||||||
|
assert_complete_any "2to3 "
|
||||||
|
sync_after_int
|
||||||
|
|
||||||
|
|
||||||
|
teardown
|
Loading…
x
Reference in New Issue
Block a user