From d58e5061ad49a3778dd1295e28810ad1f6e44cf6 Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Tue, 3 Mar 2009 15:04:15 +0000 Subject: Mikael Magnusson: 26670: add zsh/attr module --- Completion/Zsh/Command/.distfiles | 1 + Completion/Zsh/Command/_zattr | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+) create mode 100644 Completion/Zsh/Command/_zattr (limited to 'Completion/Zsh') diff --git a/Completion/Zsh/Command/.distfiles b/Completion/Zsh/Command/.distfiles index 54e1f75e9..9e8e6adc4 100644 --- a/Completion/Zsh/Command/.distfiles +++ b/Completion/Zsh/Command/.distfiles @@ -37,6 +37,7 @@ _unsetopt _vared _wait _which +_zattr _zcompile _zed _zftp diff --git a/Completion/Zsh/Command/_zattr b/Completion/Zsh/Command/_zattr new file mode 100644 index 000000000..e3836f247 --- /dev/null +++ b/Completion/Zsh/Command/_zattr @@ -0,0 +1,34 @@ +#compdef zgetattr zsetattr zdelattr zlistattr + +local state line expl ret=1 REPLY +local -a args privs + +case $service in +zgetattr) +_arguments \ + '1:file:_files' \ + '2:attribute:->attrs' \ + '3:parameter' +;; +zsetattr) +_arguments \ + '1:file:_files' \ + '2:attribute:->attrs' \ + '3:value' +;; +zdelattr) +_arguments \ + '1:file:_files' \ + '2:attribute:->attrs' +;; +zlistattr) +_arguments \ + '1:file:_files' \ + '2:parameter' +;; +esac + +if [[ $state = attrs ]]; then + zlistattr $line[1] REPLY + _wanted attrs expl 'attribute' compadd ${(0)REPLY} +fi -- cgit 1.4.1