Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
PATCH: namei completion
- X-seq: zsh-workers 54899
- From: Oliver Kiddle <opk@xxxxxxx>
- To: Zsh workers <zsh-workers@xxxxxxx>
- Subject: PATCH: namei completion
- Date: Fri, 03 Jul 2026 18:06:23 +0200
- Archived-at: <https://zsh.org/workers/54899>
- List-id: <zsh-workers.zsh.org>
One of the many tools from util-linux. Just using _files for completion
but it is mostly useful with full paths to check permissions on all the
path components leading up to a file.
Oliver
diff --git a/Completion/Linux/Command/_namei b/Completion/Linux/Command/_namei
new file mode 100644
index 000000000..6f3533eec
--- /dev/null
+++ b/Completion/Linux/Command/_namei
@@ -0,0 +1,15 @@
+#compdef namei
+
+local ign
+
+(( $#words > 2 )) && ign='!(* -)'
+_arguments -s -S \
+ '(-x --mountpoints)'{-x,--mountpoints}"[mark mount point directories with a 'D']" \
+ '(-m --modes -l --long)'{-m,--modes}'[show the permission bits of each file]' \
+ '(-o --owners -l --long)'{-o,--owners}'[show owner and group of each file]' \
+ '(-l --long -m --modes -o --owners -v --vertical)'{-l,--long}'[use long listing format (-m -o -v)]' \
+ '(-n --nosymlinks)'{-n,--nosymlinks}"[don't follow symlinks]" \
+ '(-v --vertical -l --long)'{-v,--vertical}'[align modes and owners vertically]' \
+ "$ign"{-h,--help}'[display usage information]' \
+ "$ign"{-V,--version}'[display version information]' \
+ '*: :_files'
Messages sorted by:
Reverse Date,
Date,
Thread,
Author