diff options
author | Tanaka Akira <akr@users.sourceforge.net> | 1999-11-12 15:28:24 +0000 |
---|---|---|
committer | Tanaka Akira <akr@users.sourceforge.net> | 1999-11-12 15:28:24 +0000 |
commit | e6282df1155e8d9b08b2e518a452c1997973f1ce (patch) | |
tree | b0c8ed7e8512cc4397ae7df6d138ea66147565b3 /Completion/User/_mount | |
parent | 167b0ae3b98938f75287dcf2e112d41a03532c5f (diff) | |
download | zsh-e6282df1155e8d9b08b2e518a452c1997973f1ce.tar.gz zsh-e6282df1155e8d9b08b2e518a452c1997973f1ce.tar.xz zsh-e6282df1155e8d9b08b2e518a452c1997973f1ce.zip |
manual/8630
Diffstat (limited to 'Completion/User/_mount')
-rw-r--r-- | Completion/User/_mount | 29 |
1 files changed, 16 insertions, 13 deletions
diff --git a/Completion/User/_mount b/Completion/User/_mount index 579f24381..39e31ee35 100644 --- a/Completion/User/_mount +++ b/Completion/User/_mount @@ -5,7 +5,7 @@ # arguments for the `mount' command for different operating systems # are below these table. -local state line ret=1 args fss deffs=iso9660 descr tmp +local context state line ret=1 args fss deffs=iso9660 descr tmp typeset -A opt_args if (( ! $+_fs_any )); then @@ -228,11 +228,15 @@ fi case "$state" in fstype) + _tags "$context" types || return 1 + compset -P '*,' _description expl 'file system type' compadd "$expl[@]" -qS, -M 'L:|no=' - "$fss[@]" && ret=0 ;; fsopt) + _tags "$context" options || return 1 + eval 'tmp=(' '"$_fs_'${(s:,:)^${opt_args[-t]:-${deffs}}}'[@]"' ')' tmp=( "$_fs_any[@]" "${(@)tmp:#}" ) _values -s , 'file system options' "$tmp[@]" && ret=0 @@ -241,25 +245,24 @@ devordir) if (( $+opt_args[-a] )); then _message "no device or directory with option \`-a'" else - _description expl device - compadd "$expl[@]" /dev/* && ret=0 - if (( ! $+opt_args[-t] )); then - _description expl 'mount point' - _files "$expl[@]" -/ && ret=0 - fi + _alternative "$context" \ + 'devices:device:compadd /dev/\*' \ + 'directories:mount point:_files -/' && ret=0 fi ;; udevordir) if (( $+opt_args[-a] )); then _message "no device or directory with option \`-a'" else + local dev_tmp mp_tmp + tmp=( "${(@f)$(< /etc/mtab)}" ) - _description expl device - compadd "$expl[@]" - "${(@)${(@)tmp%% *}:#none}" && ret=0 - if (( ! $+opt_args[-t] )); then - _description expl 'mount point' - compadd "$expl[@]" - "${(@)${(@)tmp#* }%% *}" - fi + dev_tmp=( "${(@)${(@)tmp%% *}:#none}" ) + mp_tmp=( "${(@)${(@)tmp#* }%% *}" ) + + _alternative "$context" \ + 'devices:device:compadd - $dev_tmp[@]' \ + 'directories:mount point:compadd - $mp_tmp[@]' && ret=0 fi ;; esac |