summaryrefslogtreecommitdiff
path: root/Completion/Unix/Command/_touch
diff options
context:
space:
mode:
authorAxel Beckert <abe@deuxchevaux.org>2016-12-04 04:32:03 +0100
committerAxel Beckert <abe@deuxchevaux.org>2016-12-04 04:32:03 +0100
commit3e439c3863f14c82f70666804c8570a13b3732e6 (patch)
tree07036c43e0f3f9242bb6dd42cd2a849ec8ea8aca /Completion/Unix/Command/_touch
parent2aedc4b88fd0e87b89583983951b04b96f48efd3 (diff)
parent7b7e84f0815ed22a0ee348a217776529035dccf3 (diff)
downloadzsh-3e439c3863f14c82f70666804c8570a13b3732e6.tar.gz
zsh-3e439c3863f14c82f70666804c8570a13b3732e6.zip
Merge tag 'zsh-5.2-test-1' into debian
Diffstat (limited to 'Completion/Unix/Command/_touch')
-rw-r--r--Completion/Unix/Command/_touch45
1 files changed, 45 insertions, 0 deletions
diff --git a/Completion/Unix/Command/_touch b/Completion/Unix/Command/_touch
new file mode 100644
index 000000000..9b9144756
--- /dev/null
+++ b/Completion/Unix/Command/_touch
@@ -0,0 +1,45 @@
+#compdef touch gtouch
+
+local args variant
+_pick_variant -r variant gnu=GNU $OSTYPE --version
+
+args=(
+ '-a[change access time (atime)]'
+ '-m[change modification time (mtime)]'
+ '(-r -d --date --reference 1)-t+[use specified time]:time ([[CC]YY]MMDDhhmm[.SS])'
+)
+case $variant in
+ gnu)
+ args+=(
+ '(-c --no-create)'{-c,--no-create}"[don't create file if it doesn't exist]"
+ '(-h --no-dereference)'{-h,--no-dereference}'[act on symbolic links themselves]'
+ '(-t -d --date -r --reference)'{-r+,--reference=}'[use corresponding times from specified reference file]:file:_files'
+ '(-t -d --date -r --reference)'{-d+,--date=}'[use specified date/time]:date/time'
+ '*--time=[change specified time]:time:(atime access use mtime modify)'
+ '(-)--help[display help information]'
+ '(-)--version[display version information]'
+ )
+ ;;
+ darwin*|dragonfly*|freebsd*)
+ args+=(
+ '(-c 1)-A+[adjust time stamps by relative value]:time delta ([[-][hh]mm]SS)'
+ )
+ ;|
+ darwin*|dragonfly*|freebsd*|netbsd*)
+ args+=( '-h[act on symbolic links themselves]' )
+ ;|
+ dragonfly*|freebsd*|openbsd*|solaris*)
+ args+=( '(-r -t 1)-d+[use specified date/time]:date/time' )
+ ;|
+ darwin*|dragonfly*|freebsd*|netbsd*|solaris*)
+ args+=( '1:: :_guard "[0-9]#" "timespec (MMDDhhmm[YY])"' )
+ ;|
+ *) # not GNU
+ args=( -A "-*" $args
+ "(-A)-c[don't create file if it doesn't exist]"
+ '(-t -d 1)-r+[use corresponding times from specified reference file]:file:_files'
+ )
+ ;;
+esac
+
+_arguments -s -S $args '*:file:_files'