[Bash-completion-commits] [SCM] bash-completion branch, master, updated. 2.1-22-ga4b69e7
Ville Skyttä
ville.skytta at iki.fi
Sun Jul 21 10:28:30 UTC 2013
The following commit has been merged in the master branch:
commit a4b69e75873b9b24e1da0c6bda22d42365cc97ac
Author: Ville Skyttä <ville.skytta at iki.fi>
Date: Sun Jul 21 13:28:23 2013 +0300
2to3: New completion.
diff --git a/completions/prelink b/completions/2to3
similarity index 55%
copy from completions/prelink
copy to completions/2to3
index f84261d..a977f20 100644
--- a/completions/prelink
+++ b/completions/2to3
@@ -1,27 +1,24 @@
-# prelink(8) completion -*- shell-script -*-
+# bash completion for 2to3 -*- shell-script -*-
-_prelink()
+_2to3()
{
local cur prev words cword split
_init_completion -s || return
case $prev in
- -'?'|--help|--usage|-V|--version|-r|--reloc-only)
+ -h|--help|--add-suffix)
return
;;
- -b|--black-list|--dynamic-linker|--undo-output)
- _filedir
+ -f|--fix|-x|--nofix)
+ COMPREPLY=( $( compgen -W \
+ "$( $1 --list-fixes 2>/dev/null | sed -e 1d )" -- "$cur" ) )
return
;;
- -c|--config-file)
- _filedir conf
+ -j|--processes)
+ COMPREPLY=( $( compgen -W "{1..$(_ncpus)}" -- "$cur" ) )
return
;;
- -C|--cache)
- _filedir cache
- return
- ;;
- --ld-library-path)
+ -o|--output-dir)
_filedir -d
return
;;
@@ -35,8 +32,8 @@ _prelink()
return
fi
- _filedir
+ _filedir py
} &&
-complete -F _prelink prelink
+complete -F _2to3 2to3
# ex: ts=4 sw=4 et filetype=sh
diff --git a/completions/Makefile.am b/completions/Makefile.am
index 899ef85..1b01eb2 100644
--- a/completions/Makefile.am
+++ b/completions/Makefile.am
@@ -1,5 +1,6 @@
bashcompdir = $(pkgdatadir)/completions
-bashcomp_DATA = 7z \
+bashcomp_DATA = 2to3 \
+ 7z \
a2x \
abook \
aclocal \
diff --git a/test/completion/2to3.exp b/test/completion/2to3.exp
new file mode 100644
index 0000000..9efdd77
--- /dev/null
+++ b/test/completion/2to3.exp
@@ -0,0 +1 @@
+assert_source_completions 2to3
diff --git a/test/lib/completions/7z.exp b/test/lib/completions/2to3.exp
similarity index 80%
copy from test/lib/completions/7z.exp
copy to test/lib/completions/2to3.exp
index 08d6bf1..101fbf8 100644
--- a/test/lib/completions/7z.exp
+++ b/test/lib/completions/2to3.exp
@@ -11,7 +11,7 @@ proc teardown {} {
setup
-assert_complete_any "7z "
+assert_complete_any "2to3 "
sync_after_int
--
bash-completion
More information about the Bash-completion-commits
mailing list