From 43247252ddeedcf3955b030f2c77064089581cb0 Mon Sep 17 00:00:00 2001 From: dana Date: Mon, 17 Dec 2018 14:49:33 -0600 Subject: 43897: Add/update various completion functions * Update tail to support -q/-v on NetBSD * Add several new functions (with one change needed to _hosts compdefs) --- Completion/Unix/Command/_mknod | 45 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 Completion/Unix/Command/_mknod (limited to 'Completion/Unix/Command/_mknod') diff --git a/Completion/Unix/Command/_mknod b/Completion/Unix/Command/_mknod new file mode 100644 index 000000000..902f49b9f --- /dev/null +++ b/Completion/Unix/Command/_mknod @@ -0,0 +1,45 @@ +#compdef mknod gmknod + +# - @todo Major/minor device numbers could be completed using /proc/devices on +# Linux and e.g. `stat -f %Hr /dev/*` on BSD/Darwin +# - @todo Device numbers should not be completed given p or w types + +local -a aopts args + +if _pick_variant gnu='Free Soft' $OSTYPE --version; then + args=( + '(: * -)--help[display help information]' + '(: * -)--version[display version information]' + '(-m --mode)'{-m+,--mode=}'[specify file mode]: :_file_modes' + '1:special file:_files' + '2:special file type:(( + b\:"block (buffered) special file" + {c,u}\:"character (unbuffered) special file" + p\:FIFO + ))' + '3:major device number' + '4:minor device number' + ) + [[ $OSTYPE == linux* ]] && args+=( + '(--context)-Z[set SELinux security context to default]' + '(-Z)--context=-[like -Z, or specify SELinux security context]:SELinux security context' + ) +else + aopts=( -A '-*' ) + args=( + '-F+[specify device-number format]:device-number format:( + native 386bsd 4bsd bsdos freebsd hpux isc linux netbsd osf1 sco solaris + sunos svr3 svr4 ultrix + )' + '1:special file:_files' + '2:special file type:(( + b\:"block-type device" + c\:"character-type device" + w\:"whiteout node" + ))' + '3:major device number' + '4:minor device number' + ) +fi + +_arguments -s -S $aopts : $args -- cgit 1.4.1