diff --git a/_osc b/_osc index ad90ee1..2b47c8e 100644 --- a/_osc +++ b/_osc @@ -1,6 +1,6 @@ #compdef osc # -# Copyright (C) 2009 Holger Macht +# Copyright (C) 2009,2010 Holger Macht # # This file is released under the GPLv2. # @@ -8,9 +8,22 @@ # # 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.1 +# 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() { @@ -29,7 +42,7 @@ _osc() { _osc_cmd_getbinaries elif [ "$cmd" = "checkout" -o "$cmd" = "co" -o "$cmd" = "branch" ]; then _osc_cmd_checkout - elif [ "$cmd" = "buildlog" -o "$cmd" = "buildinfo" ]; then + elif [ "$cmd" = "buildlog" -o "$cmd" = "buildinfo" -o "$cmd" = "bl" ]; then _osc_cmd_buildlog else _osc_cmd_do $cmd @@ -57,21 +70,21 @@ _osc() { _osc_cmd_getbinaries() { _arguments \ - '1:PROJECT:(PROJECT)' \ + '1:PROJECT:( `echo $OSC_PROJECTS` )' \ '2:PACKAGE:(PACKAGE)' \ - '3:REPOSITORY:( openSUSE_10.2 openSUSE_10.3 openSUSE_11.0 openSUSE_11.1 openSUSE_Factory SUSE_SLE-11_GA )' \ + '3:REPOSITORY:( `echo $OSC_BUILD_TARGETS` )' \ '4:ARCHITECTURE:(i586 x86_64)' } _osc_cmd_checkout() { _arguments \ - '1:PROJECT:( openSUSE:Factory openSUSE:11.1 openSUSE:11.0 openSUSE:10.3 )' \ + '1:PROJECT:( `echo $OSC_PROJECTS` )' \ '2:PACKAGE:(PACKAGE)' } _osc_cmd_buildlog() { _arguments \ - '1:REPOSITORY:( openSUSE_10.2 openSUSE_10.3 openSUSE_11.0 openSUSE_11.1 openSUSE_Factory SUSE_SLE-11_GA )' \ + '1:REPOSITORY:( `echo $OSC_BUILD_TARGETS` )' \ '2:ARCHITECTURE:(i586 x86_64)' } diff --git a/zsh.changes b/zsh.changes index ae29f52..09a2a98 100644 --- a/zsh.changes +++ b/zsh.changes @@ -1,3 +1,12 @@ +------------------------------------------------------------------- +Tue Mar 9 11:50:17 CET 2010 - hmacht@suse.de + +- update completion for _osc: + - add new products openSUSE 11.2 and openSUSE 11.3 + - add possibility to extend the list of projects and build + targets with user defined variables + $ZSH_OSC_BUILD_TARGETS_EXTRA and $ZSH_OSC_PROJECTS_EXTRA + ------------------------------------------------------------------- Wed Dec 2 18:14:17 UTC 2009 - coolo@novell.com