summaryrefslogtreecommitdiffstats
path: root/Completion/Unix/Command/_osc
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2010-08-05 19:33:47 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2010-08-05 19:33:47 +0000
commit0fa931ab7ff4eee2d56052892600d43189bdcc23 (patch)
tree7126d8db1841ea7150338e51227c1dbef4cd45bd /Completion/Unix/Command/_osc
parentSeth House: 28114: vcs_info, git: Fix revision lookup with packed repositories. (diff)
downloadzsh-0fa931ab7ff4eee2d56052892600d43189bdcc23.tar
zsh-0fa931ab7ff4eee2d56052892600d43189bdcc23.tar.gz
zsh-0fa931ab7ff4eee2d56052892600d43189bdcc23.tar.bz2
zsh-0fa931ab7ff4eee2d56052892600d43189bdcc23.tar.lz
zsh-0fa931ab7ff4eee2d56052892600d43189bdcc23.tar.xz
zsh-0fa931ab7ff4eee2d56052892600d43189bdcc23.tar.zst
zsh-0fa931ab7ff4eee2d56052892600d43189bdcc23.zip
Holger Macht: 28130: new osc completion
Diffstat (limited to 'Completion/Unix/Command/_osc')
-rw-r--r--Completion/Unix/Command/_osc149
1 files changed, 149 insertions, 0 deletions
diff --git a/Completion/Unix/Command/_osc b/Completion/Unix/Command/_osc
new file mode 100644
index 000000000..2808f92ee
--- /dev/null
+++ b/Completion/Unix/Command/_osc
@@ -0,0 +1,149 @@
+#compdef osc
+#
+# Copyright (C) 2009,2010 Holger Macht <holger@homac.de>
+#
+# This file is released under the GPLv2.
+#
+# Based on the the zsh guide from http://zsh.dotsrc.org/Guide/zshguide06.html
+#
+# Toggle verbose completions: zstyle ':completion:*:osc:*' verbose no
+# zstyle ':completion:*:osc-subcommand:*' verbose no
+#
+# Use the variables $ZSH_OSC_BUILD_TARGETS_EXTRA and $ZSH_OSC_PROJECTS_EXTRA to
+# extend the list of possible completions in your ~/.zshrc like that:
+# export OSC_PROJECTS_EXTRA="Base:System Base:shells"
+#
+# version 0.2
+#
+
+OSC_BUILD_TARGETS="openSUSE_10.2 openSUSE_10.3 openSUSE_11.0 openSUSE_11.1 openSUSE_11.2 openSUSE_11.3 openSUSE_Factory"
+OSC_PROJECTS="openSUSE:Factory openSUSE:11.2 openSUSE:11.3 openSUSE:11.1 openSUSE:11.0 openSUSE:10.3"
+
+# user defined variables $OSC_BUILD_TARGETS_EXTRA and
+# $OSC_PROJECTS_EXTRA can add to the project/build target list
+OSC_BUILD_TARGETS="$OSC_BUILD_TARGETS $ZSH_OSC_BUILD_TARGETS_EXTRA"
+OSC_PROJECTS="$OSC_PROJECTS $ZSH_OSC_PROJECTS_EXTRA"
+
+# Main dispatcher
+
+_osc() {
+ if (( CURRENT > 2 )) && [[ ${words[2]} != "help" ]]; then
+ # Remember the subcommand name
+ local cmd=${words[2]}
+ # Set the context for the subcommand.
+ curcontext="${curcontext%:*:*}:osc-subcommand"
+ # Narrow the range of words we are looking at to exclude `osc'
+ (( CURRENT-- ))
+ shift words
+ # Run the completion for the subcommand
+ if [ "$cmd" = "submitreq" -o "$cmd" = "sr" ]; then
+ _osc_cmd_submitreq
+ elif [ "$cmd" = "getbinaries" ]; then
+ _osc_cmd_getbinaries
+ elif [ "$cmd" = "checkout" -o "$cmd" = "co" -o "$cmd" = "branch" ]; then
+ _osc_cmd_checkout
+ elif [ "$cmd" = "buildlog" -o "$cmd" = "buildinfo" -o "$cmd" = "bl" ]; then
+ _osc_cmd_buildlog
+ else
+ _osc_cmd_do $cmd
+ fi
+ else
+ local hline
+ local -a cmdlist
+ local tag=0