From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Date: Mon, 13 Apr 2009 00:22:52 +0400 From: "Alexey I. Froloff" To: ALT Devel discussion list Message-ID: <20090412202251.GI9102@altlinux.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="y2zxS2PfCDLh6JVG" Content-Disposition: inline User-Agent: Mutt/1.5.19 (2009-01-05) Subject: [devel] =?koi8-r?b?Z2l0LmFsdCDJIHpzaA==?= X-BeenThere: devel@lists.altlinux.org X-Mailman-Version: 2.1.12 Precedence: list Reply-To: ALT Linux Team development discussions List-Id: ALT Linux Team development discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Apr 2009 20:22:53 -0000 Archived-At: List-Archive: List-Post: --y2zxS2PfCDLh6JVG Content-Type: multipart/mixed; boundary="DrWhICOqskFTAXiy" Content-Disposition: inline --DrWhICOqskFTAXiy Content-Type: text/plain; charset=koi8-r Content-Disposition: inline Content-Transfer-Encoding: quoted-printable =FA=C4=D2=C1=D7=D3=D4=D7=D5=CA=D4=C5, =CD=CF=C9 =C0=CE=D9=C5 =CC=C0=C2=C9= =D4=C5=CC=C9 =C6=D5=D4=C2=CF=CC=C1! =F3=C5=C7=CF=C4=CE=D1 =D1 =D0=CF=CB=C1= =D6=D5 =D7=C1=CD =CE=C5=D3=CB=CF=CC=D8=CB=CF =C6=D5=D4=C2=CF=CC=D8=CE=D9=C8 =C8=C9=D4=D2=CF= =D3=D4=C5=CA, =C1 =D0=CF=CD=CF=D6=C5=D4 =CD=CE=C5 =D7 =DC=D4=CF=CD =CD=CF= =CA =DB=C5=CC=CC zsh. 1. =EE=C1=D3=D4=D2=C1=C9=D7=C1=C5=CD =D7 .ssh/config =C8=CF=D3=D4 "git.alt"= =CB=C1=CB =CF=D0=C9=D3=C1=CE=CF =D7 =F2=D5=CB=CF=D7=CF=C4=D3=D4=D7=C5 =ED=C1=CE=D4=C5=C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.alt =C9 =C8=CF=D3=D4=C1 git.alt =D7 .ssh/co= nfig. Known bugs: =CB=D2=C9=D7=CF =C4=CF=D0=CF=CC=CE=D1=C5=D4=D3=D1 acl nmu add/d= el. --=20 Regards, Sir Raorn. --DrWhICOqskFTAXiy Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=_git_alt #compdef git.alt local context state line local curcontext=$curcontext ret=1 declare -A opt_args local -a git_alt_commands local -a git_alt_repositories git_alt_commands=( 'help:show git.alt command reference' 'charset:set default character encoding for repository' 'clone:clone repository' 'find-package:search repository' 'init-db:create new repository' 'ls:list git.alt directory' 'mv-db:rename/move repository' 'quota:show user quota information' 'rm-db:delete repository' 'task:manage tasks' 'build:build package' 'acl:manage package access control lists' ) git_alt_repositories=( 'sisyphus:Sisyphus' '5.0:branch/5.0' '4.1:branch/4.1' '4.0:branch/4.0' ) __git_alt_commands() { _describe -t git.alt-commands 'git.alt command' git_alt_commands && ret=0 } __git_alt_repositories() { _describe -t git.alt-repositories 'binary repository' git_alt_repositories && ret=0 } __git_alt_package_repository() { local -a repos repos=( ${${${${${${${${${(f)"$(_call_program package-repos git.alt ls packages)"}:#total *}##[^ ]## ##}##[^ ]## ##}##[^ ]## ##}##[^ ]## ##}##[^ ]## ##}##[^ ]## ##}%.git} ) _describe -t git.alt-package-repos 'package repository' repos && ret=0 } __git_alt_package_tag() { local -a tags tags=( ${(M)${${${${(f)"$(_call_program package-tags git ls-remote -t git.alt:packages/${words[(( CURRENT - 1 ))]}.git)"}:#*\^\{\}}##* }#refs/tags/}:#*-alt*} ) _describe -t git.alt-package-tags 'tag' tags && ret=0 } __git_alt_task_id() { local -a tasks tasks=(${${${${(f)"$(_call_program tasks git.alt task ls)"}#\#}//:/\\:}/ /:}) _describe -t git.alt-tasks 'task id' tasks && ret=0 } __git_alt_subtask_id() { _guard "[[:digit:]]#" "subtask id" && ret=0 } __git_alt-help() { _message 'no more options' && ret=0 } __git_alt-charset() { _arguments \ ':repository:' \ ':character set:' && ret=0 } __git_alt-clone() { _arguments \ ':source:' \ '::destination:' && ret=0 } __git_alt-find-package() { _arguments \ ':pattern:' && ret=0 } __git_alt-init-db() { _arguments \ ':repository:' && ret=0 } __git_alt-ls() { _arguments \ '::directory:' && ret=0 } __git_alt-mv-db() { _arguments \ ':source:' \ ':destination:' && ret=0 } __git_alt-quota() { _message 'no more options' && ret=0 } __git_alt-rm-db() { _arguments \ ':repository:' && ret=0 } __git_alt-task() { local -a task_commands task_commands=( 'ls:list tasks' 'show:show task' 'new:create task' 'add:add subtask' 'delsub:delete subtask' 'run:run task' 'share:make task shared' 'approve:approve task' 'rm:delete task' ) __git_alt-task-ls() { _arguments \ '(:)--help[show help]' \ '--all[show all tasks]' && ret=0 } __git_alt-task-show() { _arguments \ '(:)--help[show help]' \ '::task id:__git_alt_task_id' && ret=0 } __git_alt-task-new() { _arguments \ '(:)--help[show help]' \ ':binary repository:__git_alt_repositories' && ret=0 } __git_alt-task-add() { local -a task_add_commands task_add_commands=( 'repo:build from git repository' 'del:delete package' 'copy:copy from another repository' ) __git_alt-task-add-repo() { _arguments \ ':package:__git_alt_package_repository' \ ':tag:__git_alt_package_tag' && ret=0 } __git_alt-task-add-del() { _arguments \ ':package:' && ret=0 } __git_alt-task-add-copy() { _arguments \ ':package:' \ '::binary repository:__git_alt_repositories' && ret=0 } _arguments -A -C \ '(:)--help[show help]' \ '::task id:__git_alt_task_id' \ '*::git.alt task add command:->git-alt-task-add-command' && ret=0 case $state in (git-alt-task-add-command) if (( CURRENT == 1 )); then _describe -t git.alt-task-add-commands 'git.alt task add command' task_add_commands && ret=0 else curcontext="${curcontext%:*:*}:git-alt-task-add-$words[1]:" _call_function ret __git_alt-task-add-$words[1] fi ;; esac } __git_alt-task-delsub() { _arguments \ '(:)--help[show help]' \ ':task id:__git_alt_task_id' \ ':subtask id:__git_alt_subtask_id' && ret=0 } __git_alt-task-run() { _arguments \ '(:)--help[show help]' \ '::task id:__git_alt_task_id' && ret=0 } __git_alt-task-share() { _arguments \ '(:)--help[show help]' \ ':task id:__git_alt_task_id' \ ':command:((status\:"show status" enabled\:"share task" disabled\:"unshare task"))' && ret=0 } __git_alt-task-approve() { _arguments \ '(:)--help[show help]' \ ':task id:__git_alt_task_id' \ ':subtask id:__git_alt_subtask_id' && ret=0 } __git_alt-task-rm() { _arguments \ '(- :)--help[show help]' \ '::task id:__git_alt_task_id' && ret=0 } _arguments -A -C \ '(:)--help[show help]' \ '*::git.alt task command:->git-alt-task-command' && ret=0 case $state in (git-alt-task-command) if (( CURRENT == 1 )); then _describe -t git.alt-task-commands 'git.alt task command' task_commands && ret=0 else curcontext="${curcontext%:*:*}:git-alt-task-$words[1]:" _call_function ret __git_alt-task-$words[1] fi ;; esac } __git_alt-build() { _arguments -A -C \ '(- :)--help[show help]' \ '-b[binary repository name]:binary repository:__git_alt_repositories' \ '*::package-or-tag:->package-or-tag' && ret=0 case $state in (package-or-tag) if (( CURRENT % 2 == 0)); then _call_function ret __git_alt_package_tag else _call_function ret __git_alt_package_repository fi ;; esac } __git_alt-acl() { local -a acl_package_commands local -a acl_group_commands local -a acl_commands acl_group_commands=( 'check' 'show' 'add' 'del' 'leader' 'replace' ) acl_package_commands=( 'nmu' ) __git_alt-acl-check() { _message 'no more options' && ret=0 } __git_alt-acl-show() { } __git_alt-acl-add() { _message 'no more options' && ret=0 } _arguments -A -C \ '(- :)--help[show help]' \ '(- :)--list[list repositories]' \ ':binary repository:__git_alt_repositories' \ ':package:' \ '*:git.alt acl command:->git-alt-acl-command' && ret=0 if (( CURRENT == 4 )); then case $words[(( CURRENT - 1 ))] in (@*) acl_commands=( $acl_group_commands ) ;; (*) acl_commands=( $acl_group_commands $acl_package_commands ) ;; esac _describe -t git.alt-acl-commands 'git.alt acl command' acl_commands && ret=0 else curcontext="${curcontext%:*:*}:git-alt-acl-$words[4]:" case $words[4] in (check|show) _message 'no more options' && ret=0 ;; (add|del|leader|replace) _arguments \ '*:login or @group:' && ret=0 ;; (nmu) if (( CURRENT == 5 )); then local -a acl_nmu_commands acl_nmu_commands=( 'show' 'add' 'del' ) _describe -t git.alt-acl-nmu-commands 'git.alt acl nmu command' acl_nmu_commands && ret=0 else curcontext="${curcontext%:*:*}:git-alt-acl-nmu-$words[5]:" case $words[5] in (show) _message 'no more options' && ret=0 ;; (add|del) _arguments \ ':login:' \ ':start date:' \ ':end date:' && ret=0 ;; esac fi ;; esac fi } _arguments \ '*::git.alt command:->git-alt-command' && return case $state in (git-alt-command) if (( CURRENT == 1 )); then __git_alt_commands else curcontext="${curcontext%:*:*}:git-alt-$words[1]:" _call_function ret __git_alt-$words[1] fi ;; esac return ret # vim:set ts=4 sw=4: --DrWhICOqskFTAXiy-- --y2zxS2PfCDLh6JVG Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) iEYEARECAAYFAkniTZcACgkQVqT7+fkT8wrr7ACeNnvPQKQX333bjJxE5mPiUPoB ocwAoMxvgVWp7dryxWAGaZ5mVMb3rcd8 =K2Zs -----END PGP SIGNATURE----- --y2zxS2PfCDLh6JVG--