diff options
author | Axel Beckert <abe@deuxchevaux.org> | 2018-04-07 15:12:57 +0200 |
---|---|---|
committer | Axel Beckert <abe@deuxchevaux.org> | 2018-04-07 15:12:57 +0200 |
commit | 6e1ab9aa550695ee7e3d467b4173c0b83ba7f759 (patch) | |
tree | 8fb7faa4364a7cbf1cba48296a5f537e13f2a8d9 /Completion/Unix/Command/_mv | |
parent | 5ad56a41f1ee2e61abca079f5ea8909f895ac2dd (diff) | |
parent | f027f1d6e876708bc75d4217e1ca26898658d8d3 (diff) | |
download | zsh-6e1ab9aa550695ee7e3d467b4173c0b83ba7f759.tar.gz zsh-6e1ab9aa550695ee7e3d467b4173c0b83ba7f759.zip |
Merge tag 'zsh-5.4.2-test-2' / 'upstream' branch into 'debian' branch
Test version 2 prior to zsh 5.5.
Diffstat (limited to 'Completion/Unix/Command/_mv')
-rw-r--r-- | Completion/Unix/Command/_mv | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/Completion/Unix/Command/_mv b/Completion/Unix/Command/_mv new file mode 100644 index 000000000..3592efee6 --- /dev/null +++ b/Completion/Unix/Command/_mv @@ -0,0 +1,42 @@ +#compdef mv gmv + +local args +if _pick_variant gnu=GNU unix --version; then + args=( + '(-b --backup -n --no-clobber)--backup=[make a backup of each existing destination file]: : _values "backup type" + {none,off}"[never make backups]" + {numbered,t}"[make numbered backups]" + {existing,nil}"[numbered backups, if they already exist]" + {simple,never}"[always make simple backups]"' + '(-b --backup -n --no-clobber)-b[make a backup of each existing destination file]' + '(-f --force -i --interactive -n --no-clobber)'{-f,--force}"[don't prompt before overwriting]" + '(-f --force -i --interactive -n --no-clobber)'{-i,--interactive}'[prompt before overwriting existing file]' + '--strip-trailing-slashes[remove any trailing slashes from each source argument]' + '(-S --suffix)'{-S+,--suffix=}'[specify the backup suffix]:backup suffix [~]' + '(-t --target-directory)'{-t+,--target-directory=}'[move all source arguments into specified directory]:directory:_directories' + '(-T --no-target-directory)'{-T,--no-target-directory}'[treat final argument as a normal file]' + '(-u --update)'{-u,--update}'[move only when destination file is older or missing]' + '(-v --verbose)'{-v,--verbose}'[show file names after they are moved]' + '(- *)--help[display usage information]' + '(- *)--version[display version information]' + ) + [[ $OSTYPE = linux* ]] && args+=( + '(-Z --context)'{-Z,--context}'[set SELinux security context of destination file to default type]' + ) +else + local pattern arg + args=( + "(-i -n)-f[don't prompt before overwriting]" + '(-f -n)-i[prompt before overwriting existing file]' + ) + for pattern arg in \ + '(darwin|dragonfly|freebsd)*' "(-f -i)-n[don't overwrite existing file]" \ + '(darwin|dragonfly|*bsd)*' '-v[show file names after they are moved]' \ + '(dragonfly|freebsd)*' "-h[if target is a symlink to a directory, don't follow it]" + do + [[ $OSTYPE = $~pattern ]] && args+=( $arg ) + done +fi + +_arguments -s -S $args \ + '*:file:_files' |