Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: [PATCH] Completion batch #3: Break _flags/_modes out of _chflags/_chmod



On 3 Jan 2018, at 18:06, Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
>I wonder if it might be better to call these _fflags and _fmodes or
>some such, since theoretically other things than files could have
>flags and modes?

I considered that, but the other type functions seemed rather vaguely named
themselves, so i thought i'd stick with tradition. How about this?

dana


diff --git a/Completion/BSD/Command/_chflags b/Completion/BSD/Command/_chflags
index f97d1cdd1..924b09acd 100644
--- a/Completion/BSD/Command/_chflags
+++ b/Completion/BSD/Command/_chflags
@@ -12,7 +12,7 @@ if [[ $OSTYPE = (darwin|dragonfly|freebsd)* ]]; then
 fi
 
 _arguments -s -A "-*" : $args \
-  ': :_flags' \
+  ': :_file_flags' \
   '*:file:_files "$own"' \
   - opth \
   '-h[act on symlinks]' \
diff --git a/Completion/BSD/Type/_flags b/Completion/BSD/Type/_file_flags
similarity index 100%
rename from Completion/BSD/Type/_flags
rename to Completion/BSD/Type/_file_flags
diff --git a/Completion/Unix/Command/_chmod b/Completion/Unix/Command/_chmod
index 80c6f33ca..af64b9eb9 100644
--- a/Completion/Unix/Command/_chmod
+++ b/Completion/Unix/Command/_chmod
@@ -3,7 +3,7 @@
 local curcontext="$curcontext" state line expl ret=1
 local -a args privs
 
-args=( '*: :->files' '1: :_modes' )
+args=( '*: :->files' '1: :_file_modes' )
 
 if _pick_variant gnu=Free\ Soft unix --version; then
   args+=(
diff --git a/Completion/Unix/Command/_find b/Completion/Unix/Command/_find
index 2bfb89825..edd46ac1c 100644
--- a/Completion/Unix/Command/_find
+++ b/Completion/Unix/Command/_find
@@ -139,7 +139,7 @@ _arguments -C $args \
   '*-nogroup' \
   '*-nouser' \
   '*-ok:program: _command_names -e:*\;::program arguments: _normal' \
-  '*-perm: :_modes' \
+  '*-perm: :_file_modes' \
   '*-print' \
   '*-prune' \
   '*-size:file size (blocks)' \
diff --git a/Completion/Unix/Command/_mkdir b/Completion/Unix/Command/_mkdir
index 830a96162..53536b01d 100644
--- a/Completion/Unix/Command/_mkdir
+++ b/Completion/Unix/Command/_mkdir
@@ -4,7 +4,7 @@ local curcontext="$curcontext" state line expl args variant ret=1
 typeset -A opt_args
 
 args=(
-  '(-m --mode)'{-m,--mode=}'[set permission mode]: :_modes'
+  '(-m --mode)'{-m,--mode=}'[set permission mode]: :_file_modes'
   '(-p --parents)'{-p,--parents}'[make parent directories as needed]'
   '(-)*: :->directories'
 )
diff --git a/Completion/Unix/Type/_modes b/Completion/Unix/Type/_file_modes
similarity index 100%
rename from Completion/Unix/Type/_modes
rename to Completion/Unix/Type/_file_modes





Messages sorted by: Reverse Date, Date, Thread, Author