summaryrefslogtreecommitdiff
path: root/Completion/Linux/Command/_chattr
diff options
context:
space:
mode:
authorAxel Beckert <abe@deuxchevaux.org>2018-04-07 15:12:57 +0200
committerAxel Beckert <abe@deuxchevaux.org>2018-04-07 15:12:57 +0200
commit6e1ab9aa550695ee7e3d467b4173c0b83ba7f759 (patch)
tree8fb7faa4364a7cbf1cba48296a5f537e13f2a8d9 /Completion/Linux/Command/_chattr
parent5ad56a41f1ee2e61abca079f5ea8909f895ac2dd (diff)
parentf027f1d6e876708bc75d4217e1ca26898658d8d3 (diff)
downloadzsh-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/Linux/Command/_chattr')
-rw-r--r--Completion/Linux/Command/_chattr42
1 files changed, 42 insertions, 0 deletions
diff --git a/Completion/Linux/Command/_chattr b/Completion/Linux/Command/_chattr
new file mode 100644
index 000000000..bf46d8b89
--- /dev/null
+++ b/Completion/Linux/Command/_chattr
@@ -0,0 +1,42 @@
+#compdef chattr
+
+local ret=1
+local -a context line state state_descr
+local -A opt_args val_args
+
+_arguments -s -S : \
+ '-f[suppress most error messages]' \
+ "-p+[set file's project number]:project number" \
+ '-R[act recursively]' \
+ '-V[output verbosely]' \
+ "-v+[set file's version/generation number]:version/generation number" \
+ '1: :->attrs' \
+ '*: :_files' \
+&& ret=0
+
+[[ $state == attrs ]] &&
+if compset -P '*[=+-]'; then
+ # These modes can't be changed with chattr: [EhINXZ]
+ _values -S '' attribute \
+ 'A[no atime updates]' \
+ 'a[append only]' \
+ 'C[no copy on write]' \
+ 'c[compressed]' \
+ 'D[no synchronous directory updates]' \
+ 'd[no dump]' \
+ 'e[extent format]' \
+ 'i[immutable]' \
+ 'j[data journalling]' \
+ 'P[project hierarchy]' \
+ 'S[synchronous updates]' \
+ 's[secure deletion]' \
+ 'T[top of directory hierarchy]' \
+ 't[no tail-merging]' \
+ 'u[undeletable]' \
+ && ret=0
+else
+ compset -P '*'
+ _values -S '' operator = + - && ret=0
+fi
+
+return ret