summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'completions/repoman')
-rw-r--r--completions/repoman65
1 files changed, 65 insertions, 0 deletions
diff --git a/completions/repoman b/completions/repoman
new file mode 100644
index 0000000..b9dac93
--- /dev/null
+++ b/completions/repoman
@@ -0,0 +1,65 @@
+# Gentoo Linux Repoman Command Completion
+#
+# $Id$
+#
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License, v2 or later
+
+# repoman completion by Jeremy Olexa <darkside@gentoo.org>
+# rewrite by Ryan Hill <dirtyepic@gentoo.org>
+
+_repoman()
+{
+ local cur prev opts modes split=false
+
+ COMPREPLY=()
+ opts="$(_parse_help ${COMP_WORDS[0]}) --commitmsg --commitmsgfile"
+ modes="ci commit fix full help manifest manifest-check scan"
+
+ _get_comp_words_by_ref -n = cur prev
+ _split_longopt && split=true
+
+ case $prev in
+ -h|--help|help|-m|--commitmsg|-V|--version)
+ return 0
+ ;;
+ --commitmsgfile)
+ _filedir
+ return 0
+ ;;
+ --digest|--if-modified)
+ COMPREPLY=( $(compgen -W 'y n' -- "$cur") )
+ return 0
+ ;;
+ --echangelog)
+ COMPREPLY=( $(compgen -W 'y n force' -- "$cur") )
+ return 0
+ ;;
+ --mode)
+ COMPREPLY=( $(compgen -W "${modes}" -- "$cur") )
+ return 0
+ ;;
+ --vcs)
+ COMPREPLY=( $(compgen -W 'cvs svn git bzr hg' -- "$cur") )
+ return 0
+ ;;
+ esac
+
+ $split && return 0
+
+ case $cur in
+ -*)
+ COMPREPLY=( $(compgen -W "$opts" -- "$cur") )
+ return 0
+ ;;
+ *)
+ COMPREPLY=( $(compgen -W "$modes" -- "$cur") )
+ return 0
+ ;;
+ esac
+
+ return 0
+} &&
+complete -F _repoman repoman
+
+# vim: ft=sh:et:ts=4:sw=4:tw=80