mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-09-22 04:31:14 +02:00
c.f. 31071: remove duplicate _osc and rename _ps to avoid name clash
This commit is contained in:
parent
a45b45eeab
commit
c2e00298c2
4 changed files with 24 additions and 167 deletions
|
@ -1,3 +1,9 @@
|
|||
2013-02-27 Oliver Kiddle <opk@zsh.org>
|
||||
|
||||
* c.f. 31071: Completion/Unix/Type/_postscript,
|
||||
Completion/Unix/Command/_psutils: remove duplicate _osc and
|
||||
rename _ps to avoid name clash
|
||||
|
||||
2013-02-22 Peter Stephenson <p.w.stephenson@ntlworld.com>
|
||||
|
||||
* 31061: Completion/Zsh/Command/_typeset: "functions" completion
|
||||
|
@ -540,5 +546,5 @@
|
|||
|
||||
*****************************************************
|
||||
* This is used by the shell to define $ZSH_PATCHLEVEL
|
||||
* $Revision: 1.5807 $
|
||||
* $Revision: 1.5808 $
|
||||
*****************************************************
|
||||
|
|
|
@ -1,149 +0,0 @@
|
|||
#compdef osc
|
||||
#
|
||||
# Copyright (C) 2009,2010 Holger Macht <holger@homac.de>
|
||||
#
|
||||
# This file is released under the GPLv2.
|
||||
#
|
||||
# Based on 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_11.2 openSUSE_11.3 openSUSE_11.4 openSUSE_12.1 openSUSE_Tumbleweed openSUSE_Factory SLE_11_SP1"
|
||||
OSC_PROJECTS="openSUSE:Factory openSUSE:Tumbleweed openSUSE:12.1 openSUSE:11.4 openSUSE:11.2 openSUSE:11.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
|
||||
_call_program help-commands osc help | while read -A hline; do
|
||||
# start parsing with "commands:"
|
||||
[[ $hline[1] = "commands:" ]] && tag=1
|
||||
# stop parsing at the line starting with "For"
|
||||
[[ $hline[1] = "For" ]] && tag=0
|
||||
[[ $tag = 0 ]] && continue
|
||||
# all commands have to start with lower case letters
|
||||
[[ $hline[1] =~ ^[A-Z] ]] && continue
|
||||
(( ${#hline} < 2 )) && continue
|
||||
|
||||
# ${hline[1]%,} truncates the last ','
|
||||
cmdlist=($cmdlist "${hline[1]%,}:${hline[2,-1]}")
|
||||
done
|
||||
_describe -t osc-commands 'osc command' cmdlist
|
||||
fi
|
||||
}
|
||||
|
||||
_osc_cmd_getbinaries() {
|
||||
_arguments \
|
||||
'1:PROJECT:( `echo $OSC_PROJECTS` )' \
|
||||
'2:PACKAGE:(PACKAGE)' \
|
||||
'3:REPOSITORY:( `echo $OSC_BUILD_TARGETS` )' \
|
||||
'4:ARCHITECTURE:(i586 x86_64)'
|
||||
}
|
||||
|
||||
_osc_cmd_checkout() {
|
||||
_arguments \
|
||||
'1:PROJECT:( `echo $OSC_PROJECTS` )' \
|
||||
'2:PACKAGE:(PACKAGE)'
|
||||
}
|
||||
|
||||
_osc_cmd_buildlog() {
|
||||
_arguments \
|
||||
'1:REPOSITORY:( `echo $OSC_BUILD_TARGETS` )' \
|
||||
'2:ARCHITECTURE:(i586 x86_64)'
|
||||
}
|
||||
|
||||
_osc_cmd_submitreq() {
|
||||
local hline
|
||||
local -a cmdlist
|
||||
local tag=0
|
||||
_call_program help-commands osc help $cmd | while read -A hline; do
|
||||
# start parsing from "usage:"
|
||||
[[ $hline[1] = "usage:" ]] && tag=1
|
||||
[[ $tag = 0 ]] && continue
|
||||
|
||||
if [[ $hline[1] =~ ^osc ]]; then
|
||||
shift hline; shift hline
|
||||
elif ! [[ $hline[1] =~ ^- ]]; then
|
||||
# Option has to start with a '-' or 'osc submitrequest'
|
||||
continue
|
||||
fi
|
||||
|
||||
(( ${#hline} < 2 )) && continue
|
||||
|
||||
cmdlist=($cmdlist "${hline[1]%,}:${hline[2,-1]}")
|
||||
|
||||
done
|
||||
|
||||
_describe -t osc-commands 'osc command' cmdlist
|
||||
}
|
||||
|
||||
|
||||
_osc_cmd_do() {
|
||||
local hline
|
||||
local -a cmdlist
|
||||
local tag=0
|
||||
|
||||
# only start completion if theres some '-' on the line
|
||||
if ! [ "$words[2]" = "-" ]; then
|
||||
_complete
|
||||
return
|
||||
fi
|
||||
|
||||
_call_program help-commands osc help $cmd | while read -A hline; do
|
||||
# start parsing from "Options:"
|
||||
[[ $hline[1] = "Options:" ]] && tag=1
|
||||
[[ $tag = 0 ]] && continue
|
||||
# Option has to start with a '-'
|
||||
[[ $hline[1] =~ ^- ]] || continue
|
||||
(( ${#hline} < 2 )) && continue
|
||||
|
||||
cmdlist=($cmdlist "${hline[1]%,}:${hline[2,-1]}")
|
||||
done
|
||||
|
||||
if [ -n "$cmdlist" ]; then
|
||||
_describe -t osc-commands 'osc command' cmdlist
|
||||
else
|
||||
_complete
|
||||
fi
|
||||
}
|
||||
|
||||
# Code to make sure _osc is run when we load it
|
||||
_osc "$@"
|
||||
|
||||
|
|
@ -13,16 +13,16 @@ epsffit)
|
|||
':lower left y:' \
|
||||
':upper right x:' \
|
||||
':upper right y:' \
|
||||
':input file:_ps' \
|
||||
':output file:_ps'
|
||||
':input file:_postscript' \
|
||||
':output file:_postscript'
|
||||
;;
|
||||
psbook)
|
||||
_arguments \
|
||||
'-q[quiet mode]' \
|
||||
'-v[print version]' \
|
||||
'-s-[signature size]:signature size:' \
|
||||
':input file:_ps' \
|
||||
':output file:_ps'
|
||||
':input file:_postscript' \
|
||||
':output file:_postscript'
|
||||
;;
|
||||
psnup)
|
||||
_arguments \
|
||||
|
@ -47,8 +47,8 @@ psnup)
|
|||
'(-2 -4 -n)-8[8 logical pages on a sheet]' \
|
||||
'(-2 -4 -8 )-n[n-up]:pages on a sheet:' \
|
||||
'-t-[layout tolerance]:layout tolerance:' \
|
||||
':input file:_ps' \
|
||||
':output file:_ps'
|
||||
':input file:_postscript' \
|
||||
':output file:_postscript'
|
||||
;;
|
||||
psresize)
|
||||
_arguments \
|
||||
|
@ -60,8 +60,8 @@ psresize)
|
|||
'(-P)-W-[input page width]:input paper width:' \
|
||||
'(-P)-H-[input page height]:input paper height:' \
|
||||
'(-W -H)-P-[input page paper]:input paper paper:(a3 a4 a5 b5 letter legal 10x14)' \
|
||||
':input file:_ps' \
|
||||
':output file:_ps'
|
||||
':input file:_postscript' \
|
||||
':output file:_postscript'
|
||||
;;
|
||||
psselect)
|
||||
_arguments \
|
||||
|
@ -71,8 +71,8 @@ psselect)
|
|||
'-o[select odd pages]' \
|
||||
'-r[reverse order]' \
|
||||
'-p-[pages]:pages:' \
|
||||
':input file:_ps' \
|
||||
':output file:_ps'
|
||||
':input file:_postscript' \
|
||||
':output file:_postscript'
|
||||
;;
|
||||
pstops)
|
||||
_arguments \
|
||||
|
@ -84,28 +84,28 @@ pstops)
|
|||
'(-p)-h-[page height]:paper height:' \
|
||||
'(-w -h)-p-[page size]:paper size:(a3 a4 a5 b5 letter legal 10x14)' \
|
||||
':[modulo\:][-]pageno[L][R][U][@scale][(xoff,yoff)][+|,]...:' \
|
||||
':input file:_ps' \
|
||||
':output file:_ps'
|
||||
':input file:_postscript' \
|
||||
':output file:_postscript'
|
||||
;;
|
||||
extractres)
|
||||
_arguments \
|
||||
'-m[merge]' \
|
||||
':input file:_ps'
|
||||
':input file:_postscript'
|
||||
;;
|
||||
fixmacps)
|
||||
_arguments \
|
||||
'-d[directory]:directory:_files -/' \
|
||||
'-n[name]:name:' \
|
||||
':input file:_ps'
|
||||
':input file:_postscript'
|
||||
;;
|
||||
psmerge)
|
||||
_arguments \
|
||||
'-o-[output file]:output file:_ps' \
|
||||
'-o-[output file]:output file:_postscript' \
|
||||
'-t[thorough]' \
|
||||
'*:input file:_ps'
|
||||
'*:input file:_postscript'
|
||||
;;
|
||||
fixdlsrps|fixfmps|fixpsditps|fixpspps|fixscribeps|fixtpps|fixwfwps|fixwpps|fixwwps|includeres)
|
||||
_ps
|
||||
_postscript
|
||||
;;
|
||||
getafm)
|
||||
_arguments \
|
||||
|
|
Loading…
Reference in a new issue