From a54d70457934662318feac9fcc750d2691250f33 Mon Sep 17 00:00:00 2001 From: Arvid Norlander Date: Sat, 14 May 2022 17:40:28 +0200 Subject: github #91: _find (gnu/freebsd/darwin): Add some flags and syntaxes * -exec and -execdir can take ; or + as an ending marker. Previously only ; was supported. This is part of POSIX for -exec (support for + for -ok is optional and none of the implementations I looked at seem to support that). * Missing completion for -files0-from (GNU find 4.9.0 and later). This flag needs to go with the global flags at the beginning and load the paths from the given file instead of from the command line. * Missing completion for the -newerXY family of flags (GNU find 4.3.3, also available in FreeBSD and MacOS at least). --- Completion/Unix/Command/_find | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'Completion/Unix/Command/_find') diff --git a/Completion/Unix/Command/_find b/Completion/Unix/Command/_find index 74111f92b..560b77f7e 100644 --- a/Completion/Unix/Command/_find +++ b/Completion/Unix/Command/_find @@ -37,6 +37,11 @@ case $variant in args+=( '*-Bmin:birth time (minutes)' '*-Bnewer:file to compare (birth time):_files' + '*-newer'{a,B,c,m}{a,B,c,m}'[if [aBcm\]time is newer than [aBcm\]time of given file]:reference file:_files' + '*-newerat[if access time is newer than given timestamp]:timestamp: ' + '*-newerBt[if birth time is newer than given timestamp]:timestamp: ' + '*-newerct[if creation time is newer than given timestamp]:timestamp: ' + '*-newermt[if modification time is newer than given timestamp]:timestamp: ' '*-Btime:birth time (hours)' ) ;| @@ -46,7 +51,7 @@ case $variant in '*-anewer:file to compare (access time):_files' '*-cnewer:file to compare (inode change time):_files' '*-empty' - '*-execdir:program: _command_names -e:*\;::program arguments: _normal' + '*-execdir:program: _command_names -e:*(\;|+)::program arguments: _normal' '*-maxdepth:maximum search depth' '*-mindepth:minimum search depth' '*-path:path pattern to search:' @@ -110,6 +115,7 @@ case $variant in '*-readable' '*-writable' '*-xtype:file type:((b\:block\ special\ file c\:character\ special\ file d\:directory p\:named\ pipe f\:normal\ file l\:symbolic\ link s\:socket))' + '-files0-from[start recursing from targets in given file]:NUL-separated targets file:_files' '*-fls:output file:_files' '*-fprint:output file:_files' '*-fprint0:output file:_files' @@ -126,7 +132,7 @@ _arguments -C $args \ '*-atime:access time (days):->times' \ '*-ctime:inode change time (days):->times' \ '*-depth' \ - '*-exec:program: _command_names -e:*\;::program arguments: _normal' \ + '*-exec:program: _command_names -e:*(\;|+)::program arguments: _normal' \ '*-follow' \ '*-fstype:file system type:_file_systems' \ '*-group:group:_groups' \ @@ -147,7 +153,7 @@ _arguments -C $args \ '*-user:user:_users' \ '*-xdev' \ '*-a' '*-o' \ - '(-D -E -H -L -O -P -f -s -x --help --version)*:directory:_files -/' \ + '(-D -E -H -L -O -P -f -s -x --files0-from --help --version)*:directory:_files -/' \ && ret=0 if [[ $state = times ]]; then -- cgit v1.2.3 From 8f0a8131fad30c627d72f24a6a88ac0053cd3790 Mon Sep 17 00:00:00 2001 From: Oliver Kiddle Date: Fri, 17 Nov 2023 18:25:21 +0100 Subject: 52307: new completion for many SELinux tools --- ChangeLog | 7 + Completion/Linux/Command/_chcon | 24 - Completion/Linux/Command/_selinux | 781 ++++++++++++++++++++++++++++++++ Completion/Linux/Command/_setpriv | 2 +- Completion/Linux/Type/_selinux_contexts | 13 +- Completion/Linux/Type/_selinux_types | 16 +- Completion/Unix/Command/_cp | 2 +- Completion/Unix/Command/_find | 4 +- Completion/Unix/Command/_install | 2 +- Completion/Unix/Command/_mount | 6 +- Completion/Unix/Command/_zfs | 2 +- 11 files changed, 821 insertions(+), 38 deletions(-) delete mode 100644 Completion/Linux/Command/_chcon create mode 100644 Completion/Linux/Command/_selinux (limited to 'Completion/Unix/Command/_find') diff --git a/ChangeLog b/ChangeLog index 5b50aa342..09b854e54 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,12 @@ 2023-11-17 Oliver Kiddle + * 52307: Completion/Linux/Command/_selinux, + Completion/Linux/Command/_chcon, Completion/Linux/Command/_setpriv, + Completion/Linux/Type/_selinux_contexts, Completion/Unix/Command/_cp, + Completion/Linux/Type/_selinux_types, Completion/Unix/Command/_find, + Completion/Unix/Command/_install, Completion/Unix/Command/_mount, + Completion/Unix/Command/_zfs: new completion for many SELinux tools + * 52303: Completion/Unix/Command/_ifconfig, Completion/Unix/Command/_chown, Completion/Unix/Command/_cp, Completion/Unix/Command/_cut, Completion/Unix/Command/_date, diff --git a/Completion/Linux/Command/_chcon b/Completion/Linux/Command/_chcon deleted file mode 100644 index 2d523f287..000000000 --- a/Completion/Linux/Command/_chcon +++ /dev/null @@ -1,24 +0,0 @@ -#compdef chcon - -local ign - -(( $#words > 2 )) && ign='!' -_arguments -C -s -S \ - '(-h --no-dereference)--dereference[dereference symlinks]' \ - '(-h --no-dereference --dereference)'{-h,--no-dereference}'[operate on symlinks themselves]' \ - '(1 -u --user -r --role -l --range -t --type)--reference=[copy security context of specified file]:file:_files' \ - '(1 --reference -u --user)'{-u+,--user=}'[set user in the target security context]: :_selinux_users' \ - '(1 --reference -r --role)'{-r+,--role=}'[set role in the target security context]: :_selinux_roles' \ - '(1 --reference -t --type)'{-t+,--type=}'[set type in the target security context]: :_selinux_types' \ - '(1 --reference -l --range)'{-l+,--range=}'[set range in the target security context]:selinux range' \ - '(--recursive -R)'{--recursive,-R}'[recurse subdirectories]' \ - '(-v --verbose)'{-v,--verbose}'[output a diagnostic for every file processed]' \ - '(-H -L -P)-H[follow symlinks on the command line]' \ - '(-H -L -P)-L[follow all symlinks]' \ - "(-H -L -P)-P[don't follow symlinks (default)]" \ - '!(--preserve-root)--no-preserve-root' \ - "--preserve-root[fail to operate recursively on '/']" \ - '(--reference -u --user -r --role -l --range -t --type)1:security context:_selinux_contexts' \ - "${ign}--help[display help information]" \ - "${ign}--version[display version information]" \ - '*:file:_files' diff --git a/Completion/Linux/Command/_selinux b/Completion/Linux/Command/_selinux new file mode 100644 index 000000000..e7d4d3b2e --- /dev/null +++ b/Completion/Linux/Command/_selinux @@ -0,0 +1,781 @@ +#compdef audit2allow audit2why avcstat chcon checkmodule checkpolicy fixfiles getpidprevcon getsebool matchpathcon restorecon runcon sealert secon sedta seinfo selinuxconlist selinuxdefcon selinuxexeccon semanage semodule semodule_unpackage sepolgen sepolicy sesearch sestatus setenforce setsebool validatetrans + +# encompasses checkpolicy libselinux-utils policycoreutils +# policycoreutils-devel policycoreutils-python-utils setools-console +# setools-console-analyses setroubleshoot-server and a few utilities from +# coreutils + +_selinux_attributes() { + local -a seattrs expl + + seattrs=( ${(f)"$(_call_program selinux-attributes seinfo --flat -a)"} ) + _description selinux-attrs expl "selinux attribute" + compadd "$@" "$expl[@]" -a seattrs +} + +_selinux_bools() { + local -a sebools expl + + sebools=( ${(f)"$(_call_program selinux-bools seinfo --flat -b)"} ) + _description selinux-bools expl "selinux boolean" + compadd "$@" "$expl[@]" -a sebools +} + +_selinux_categories() { + local -a secats expl + + secats=( ${(f)"$(_call_program selinux-categories seinfo --flat --category)"} ) + _description selinux-categories expl "selinux category" + compadd "$@" "$expl[@]" -a secats +} + +_selinux_classes() { + local -a seclasses expl + + seclasses=( ${(f)"$(_call_program selinux-classes seinfo --flat -c)"} ) + _description selinux-classes expl "selinux object class" + compadd "$@" "$expl[@]" -a seclasses +} + +_selinux_commons() { + local -a secommons expl + + secommons=( ${(f)"$(_call_program selinux-commons seinfo --flat --common)"} ) + _description selinux-commons expl "selinux common permission set" + compadd "$@" "$expl[@]" -a secommons +} + +_selinux_interfaces() { + local -a seints expl + + seints=( ${(f)"$(_call_program selinux-interfaces sepolicy interface -l)"} ) + _description selinux-interfaces expl "selinux interface" + compadd "$@" "$expl[@]" -a seints +} + +_selinux_permissions() { + local -a seperms expl + + seperms=( ${${${${(f)"$(_call_program selinux-permissions seinfo -c --flat -x)"}:#[^[:blank:]]*}#[[:blank:]]}:1} ) + _description selinux-permissions expl "selinux permission" + compadd "$@" "$expl[@]" -a seperms +} + +_selinux_sids() { + local -a sesids expl + + sesids=( ${(f)"$(_call_program selinux-sids seinfo --flat --initialsid)"} ) + _description selinux-sids expl "selinux SID" + compadd "$@" "$expl[@]" -a sesids +} + +_selinux_sens() { + local -a sens expl + + sesids=( ${(f)"$(_call_program selinux-sens seinfo --flat --initialsid)"} ) + _description selinux-sensitivities expl "selinux sensitivity" + compadd "$@" "$expl[@]" -a sesids +} + +_selinux_modules() { + local -a modules expl + + modules=( ${(f)"$(_call_program selinux-modules semodule -l)"} ) + _description selinux-modules expl "selinux module" + compadd "$@" "$expl[@]" -a modules +} + +local curcontext="$curcontext" ret=1 +local -A opt_args +local -a args sepolgen state state_descr line +local ign +(( $#words > 2 )) && ign='!' + +sepolgen=( + "${ign}(-h --help)"{-h,--help}'[display help information]' + '(--application --cgi --dbus --inetd --init --admin_user --confined_admin --desktop_user --newtype --sandbox --x_user)'*{-d+,--domain=}'[specify domain to expand]:domain:_selinux_types -a domain' + \*{-r+,--role=}'[specify role(s) to which the administrator domain will transition]: :_selinux_roles' + \*{-u+,--user=}'[specify SELinux user(s) which will transition to this domain]: :_selinux_users' + \*{-a+,--admin=}'[specify domain(s) which this confined admin will administrate]:admin domain:_selinux_types' + '(-n --name)'{-n+,--name=}'[specify name of policy to generate]:name' + '(--admin_user --confined_admin --desktop_user --newtype --sandbox --x_user)*'{-t+,--type=}'[specify type(s) for which you will generate new definition and rule(s)]:type:_selinux_types' + '(-p --path)'{-p+,--path=}'[specify path in which the generated policy files will be stored]:path:_directories' + '(--newtype)*'{-w+,--writepath=}'[specify path to which the confined processes will need to write]:path:_directories' + '1:command:_files' + + '(application)' + "(-d)--application[generate 'User Application' policy]" + "(-d)--cgi[generate 'Web Application/Script (CGI)' policy]" + "(-d)--dbus[generate 'DBUS System Daemon' policy]" + "(-d)--inetd[generate 'Internet Services Daemon' policy]" + "(-d)--init[generate 'Standard Init Daemon' policy]" + "(-d -t 1)--admin_user[generate 'Administrator Login User Role' policy]" + "(-d -t 1)--confined_admin[generate 'Confined Root Administrator Role' policy]" + "(1)--customize[generate 'Existing Domain Type' policy]" + "(-d -t 1)--desktop_user[generate 'Desktop Login User Role' policy]" + "(-d -w 1)--newtype[generate 'Module information for a new type' policy]" + "(-d -t 1)--sandbox[generate 'Sandbox' policy]" + "(-d -t 1)--term_user[generate 'Minimal Terminal Login User Role' policy]" + "(-d -t 1)--x_user[generate 'Minimal X Windows Login User Role' policy]" +) + +case $service in + check(module|policy)) + args=( + '(-b --binary)'{-b,--binary}'[read an existing binary policy file rather than a source policy.conf file]' + '(-C --cil)'{-C,--cil}'[write CIL policy file rather than binary policy file]' + '(-E --werror)'{-E,--werror}'[treat warnings as errors]' + "${ign}(-h --help)"{-h,--help}'[display help information]' + '(-U --handle-unknown)'{-U+,--handle-unknown=}'[specify how the kernel should handle unknown classes or permissions]:action:(deny allow reject)' + '(-M --mls)'{-M,--mls}'[enable the MLS policy when checking and compiling the policy]' + '(-o --output)'{-o+,--output=}'[write a policy file]:file:_files' + '-c+[specify the policy version]:policy version [latest]' + ':input file:_files' + ) + ;| + + audit2(allow|why)) + args=( + '(-b --boot -i --input)'{-b,--boot}'[audit messages since last boot]' + '(-a --all -i --input -d --dmesg)'{-a,--all}'[read input from audit log]' + '(-p --policy)'{-p+,--policy=}'[specify policy file to use for analysis]:file:_files' + '(-d --dmesg -a --all -i --input)'{-d,--dmesg}'[read input from dmesg]' + '(-i --input -a --all -b --boot)'{-i+,--input=}'[read input from file]:file:_files' + '(-l --lastreload)'{-l,--lastreload}'[read input only after the last reload]' + '(-r --requires)'{-r,--requires}'[generate require statements for rules]' + '(-m --module -M --module-package -r --requires)'{-m+,--module=}'[set the module name]:module name:_selinux_modules' + '(-M --module-package -o --output -m --module)'{-M+,--module-package=}'[generate a module package]:module package:_files' + '(-o --output -M --module-package)'{-o+,--output=}'[append output to file]:file:_files' + '(-D --dontaudit)'{-D,--dontaudit}'[generate policy with dontaudit rules]' + '(-R --reference)'{-R,--reference}'[use installed macros in generated policy]' + '!(-R --reference -N --noreference)'{-N,--noreference} + '(-v --verbose)'{-v,--verbose}'[explain generated output]' + '(-e --explain)'{-e,--explain}'[fully explain generated output]' + '(-t --type)'{-t+,--type=}'[only process messages with type matching regex]:type' + '--perm-map=[specify file name of perm map]:file:_files' + '--interface-info=[specify file name of interface information]:file:_files' + '(-x --xperms)'{-x,--xperms}'[generate extended permission rules]' + '--debug[leave generated modules for -M]' + '(-w --why)'{-w,--why}'[translate SELinux audit messages into a description of why the access was denied]' + "${ign}(-h --help)"{-h,--help}'[display help information]' + "${ign}--version[display version information]" + ) + ;; + + avcstat) + args=( + '-c[cumulative]' + '-f+[specify AVC statistics file]:file [/sys/fs/selinux/avc/cache_stats]:_files' + ': :_guard "^-*" "interval (seconds)"' + ) + ;; + + chcon) + args=( -S + '(-h --no-dereference)--dereference[dereference symlinks]' \ + '(-h --no-dereference --dereference)'{-h,--no-dereference}'[operate on symlinks themselves]' \ + '(1 -u --user -r --role -l --range -t --type)--reference=[copy security context of specified file]:file:_files' \ + '(1 --reference -u --user)'{-u+,--user=}'[set user in the target security context]: :_selinux_users' \ + '(1 --reference -r --role)'{-r+,--role=}'[set role in the target security context]: :_selinux_roles' \ + '(1 --reference -t --type)'{-t+,--type=}'[set type in the target security context]: :_selinux_types' \ + '(1 --reference -l --range)'{-l+,--range=}'[set range in the target security context]:selinux range' \ + '(--recursive -R)'{--recursive,-R}'[recurse subdirectories]' \ + '(-v --verbose)'{-v,--verbose}'[output a diagnostic for every file processed]' \ + '(-H -L -P)-H[follow symlinks on the command line]' \ + '(-H -L -P)-L[follow all symlinks]' \ + "(-H -L -P)-P[don't follow symlinks (default)]" \ + '!(--preserve-root)--no-preserve-root' \ + "--preserve-root[fail to operate recursively on '/']" \ + '(--reference -u --user -r --role -l --range -t --type)1:security context:_selinux_contexts' \ + "${ign}--help[display help information]" \ + "${ign}--version[display version information]" \ + '*:file:_files' + ) + ;; + + checkmodule) + args=( + "${ign}(-)"{-V,--version}'[show policy versions created by this program]' + '-m[build a policy module instead of a base module]' + '-c+[build a policy module targeting a modular policy version]:version (4-21)' + ) + ;; + + checkpolicy) + args=( + '(-F --conf)'{-F,--conf}'[write policy.conf file rather than binary policy file]' + '(-d --debug)'{-d,--debug}'[enter debug mode after loading the policy]' + '(-S --sort)'{-S,--sort}'[sort ocontexts before writing out the binary policy]' + '(-t --target)'{-t+,--target=}'[specify the target platform]:platform:(selinux xen)' + '(-O --optimize)'{-O,--optimize}'[optimize the final kernel policy (remove redundant rules)]' + "${ign}(-)"{-V,--version}'[display version information]' + ) + ;; + + fixfiles) + args=( + '-B[record current date in /.autorelabel to speed later labeling]' + '-F[force reset of context to match file_context for customizable files]' + '-f[clear /tmp directory without prompt for removal]' + '-R+[discover files from specified rpm packages]:package' + '-C+[run a diff on the specified file]:file:_files' + '-N+[only act on files created after the specified date]:date (YYYY-MM-DD HH\:MM):_dates' + '-v[show changes in file labels]' + '-T+[specify number of threads to use]:threads' + '1::action:(check verify restore relabel onboot)' + '*:file:_files' + ) + ;; + + getpidprevcon) + _pids + return + ;; + + getsebool) + args=( + '(:)-a[show all booleans]' + '(-a):boolean:_selinux_bools' + ) + ;; + + matchpathcon) + args=( + '-m+[force file type for the lookup]:type:(file dir pipe chr_file blk_file lnk_file sock_file)' + "-n[don't display path]" + "-N[don't use translations]" + '-f+[use alternate file_context file]:file:_files' + '-p+[use prefix to speed translations]:prefix' + '-P+[use alternate policy root path]:path:_directories' + '-V[verify file context on disk matches defaults]' + '*:file path:_files' + ) + ;; + + restorecon) + args=( + '*-e+[exclude a directory]:directory:_directories' + '-f+[provide list of files to be processed]:file:_files' + '-F[force reset of context to match file_context for customizable files]' + "-i[ignore files that don't exist]" + '-I[ignore digest to force checking of labels even if SHA256 digest matches]' + '-D[set or update any directory SHA256 digests]' + '-m[include non-seclabel mounts in relabeling checks]' + "-n[don't change any file labels (passive check)]" + '(-v)-p[show progress]' + '(-R -r)'{-R,-r}'[change file labels recursively]' + '(-p)-v[show changes in file labels]' + '-W[display warnings about entries that had no matching files]' + '-0[expect NUL characters as input filename separators]' + "-x[don't cross file system boundaries]" + '-T+[specify number of threads to use]:threads' + "${ign}(-)"{-h,-\?}'[display help information]' + '*:file path:_files' + ) + ;; + + runcon) + args=( + '(1 -c --compute)'{-c,--compute}'[compute process transition context before modifying]' + '(1 -t --type=TYPE)'{-t+,--type=}'[specify type]: :_selinux_types' + '(1 -u --user=USER)'{-u+,--user=}'[specify user identity]: :_selinux_users' + '(1 -r --role=ROLE)'{-r+,--role=}'[specify role]: :_selinux_roles' + '(1 -l --range=RANGE)'{-l+,--range=}'[specify level range]:range' + '(-)1:security context:_selinux_contexts' + '*:::args:_normal' + ) + ;; + + sealert) + args=( + '(-b --browser)'{-b,--browser}'[launch the browser]' + '(-s --service -S --noservice)'{-s,--service}'[start sealert as a dbus service]' + '(-S --noservice -s --service)'{-S,--noservice}'[start sealert without dbus service as standalone app]' + '(-l --lookupid)'{-l+,--lookupid=}'[lookup alert by id, id may be wildcard * to lookup all alerts]:id' + '(-a --analyze)'{-a+,--analyze=}'[scan a log file, analyze its AVCs]:log file:_files' + '(-u --user)'{-u+,--user=}'[logon user name]:username' + '(-p --password)'{-p+,--password=}'[logon user password]:password' + '(-P --plugin)'{-P+,--plugin=}'[specify plugin name, required for -f]:plugin name' + '(-f --fix)'{-f+,--fix=}'[fix avc with the given uuid, requires plugin]:uuid' + "${ign}(-)"{-h,--help}'[display help information]' + ) + ;; + + secon) + args=( + "${ign}(-)"{-h,--help}'[display help information]' + "${ign}(-)--version[display version information]" + '(-P --prompt)'{-P,--prompt}'[output in a format good for a prompt]' + '(-u --user)'{-u,--user}'[show user of the context]' + '(-r --role)'{-r,--role}'[show role of the context]' + '(-t --type)'{-t,--type}'[show type of the context]' + '(-s --sensitivity)'{-s,--sensitivity}'[show sensitivity level of the context]' + '(-c --clearance)'{-c,--clearance}'[show clearance level of the context]' + '(-m --mls-range)'{-m,--mls-range}'[show sensitivity to clearance range of]' + '(-R --raw)'{-R,--raw}'[output context in "raw" format]' + '(-C --color)'{-C,--color}'[output using ANSI color codes (requires -P)]' + + '(context)' + {--self,--current}'[get context for the current process]' + {--self-exec,--current-exec}'[get exec context for the current process]' + {--self-fs,--current-fs}'[get fs context for the current process]' + {--self-key,--current-key}'[get key context for the current process]' + '--parent[get context for the parent process]' + '--parent-exec[get exec context for the parent process]' + '--parent-fs[get fs context for the parent process]' + '--parent-key[get key context for the parent process]' + {-p+,--pid=}'[context from the specified pid]:pid:_pids' + '--pid-exec[use exec context from the specified pid]:pid:_pids' + '--pid-fs[use fs context from the specified pid]:pid:_pids' + '--pid-key[use key context from the specified pid]:pid:_pids' + {-f+,--file=}'[use context from the specified file]:file:_files' + {-L+,--link=}"[use context from the specified file, doesn't follow symlinks]:file:_files" + ':context:_selinux_contexts' + ) + ;; + + sedta) + args=( + '(-p --policy)'{-p+,--policy=}'[specify path to SELinux policy to analyze]:policy:_files' + '(-s --source)'{-s+,--source=}'[specify source type of the analysis]:source:_selinux_types -a domain' + '(-t --target)'{-t+,--target=}'[specify target type of the analysis]:target:_selinux_types -a domain' + '--full[print rule lists for transitions]' + '--stats[display statistics at the end of the analysis]' + '(-v --verbose)'{-v,--verbose}'[extra informational messages]' + '--debug[enable debugging]' + '(-S --shortest_path)'{-S,--shortest_path}'[calculate all shortest paths]' + '(-A --all_paths)'{-A+,--all_paths=}'[calculate all paths]:max steps' + '(-r --reverse)'{-r,--reverse}'[perform a reverse DTA]' + '(-l --limit_trans)'{-l+,--limit_trans=}'[limit to the specified number of transitions]:limit' + '*:excluded domain:_selinux_types -a domain' + "${ign}(- *)"{-h,--help}'[display help information]' + "${ign}(-)--version[display version information]" + ) + ;; + + seinfo) + args=( + '(-a --attribute)'{-a,--attribute}'[list attributes or print named attribute]:: :_selinux_attributes' + '(-b --bool)'{-b,--bool}'[list booleans or print named boolean]:: :_selinux_bools' + '(-c --class)'{-c,--class}'[list object classes or print named object class]:: :_selinux_classes' + '(-r --role)'{-r,--role}'[list roles or print named role]:: :_selinux_roles' + '(-t --type)'{-t,--type}'[list types or print named type]:: :_selinux_types' + '(-u --user)'{-u,--user}'[list users or print named user]:: :_selinux_users' + '--category[list categories or print named category]:: :_selinux_categories' + '--common[list common permission sets or print named common]:: :_selinux_commons' + '--constrain[list constraints or print constraints for named object class]:: :_selinux_classes' + '--default[list default_* statements or print statements for named object class]:: :_selinux_classes' + '--fs_use[list fs_use_* statements or print statements for named filesystem type]:: :_file_systems' + '--genfscon[list genfscon statements or print statements for named filesystem type]:: :_file_systems' + '--initialsid[list initial SIDs or print named SID]:: : _selinux_sids' + '--netifcon[list netif contexts or print for named interface]:: : _net_interfaces' + '--nodecon[list node contexts or print statement for node with specified address]::address' + '--permissive[list permissive types or print named statement]::type' + '--polcap[list policy capabilities or print named statement]::type' + '--portcon[list port contexts or print statements for port range]::port range' + '--sensitivity[list sensitivities or print named sensitivity]:: :_selinux_sens' + '--typebounds[list type bounds or print named bound type]:: :_selinux_typebounds' + '--validatetrans[list validatetrans rules or print constraints for named object class]:: :_selinux_classes' + '--all[list all components]' + '(-x --expand)'{-x,--expand}'[print additional details]' + '--flat[exclude headers and indentation in output]' + '(-v --verbose)'{-v,--verbose}'[print additional informational messages]' + '--debug[enable debugging output]' + "${ign}--help[display help information]" + "${ign}--version[display version information]" + ':policy:_files' + ) + ;; + + selinuxconlist) + args=( + '-l+[specify mcs/mls level]:level' + ':user:_selinux_users' + ':context:_selinux_contexts' + ) + ;; + + selinuxdefcon) + args=( + '-l+[specify mcs/mls level]:level' + ':user:_users' + ':context:_selinux_contexts' + ) + ;; + + selinuxexeccon) + args=( + '1:command:_files -g "*(-*)"' + '2:from context:_selinux_contexts' + ) + ;; + + semanage) + _arguments -C \ + {-h,--help}'[display help information]' \ + ': :->command' \ + '*::: := ->option-or-argument' && ret=0 + + case $state in + command) + local -a subcmds + + subcmds=( + import:'import local customizations' + export:'output local customizations' + login:'manage login mappings between linux users and SELinux confined users' + user:'manage SELinux confined users (Roles and levels for an SELinux user)' + port:'manage network port type definitions' + interface:'manage network interface type definitions' + module:'manage SELinux policy modules' + node:'manage network node type definitions' + fcontext:'manage file context mapping definitions' + boolean:'manage booleans to selectively enable functionality' + permissive:'manage process type enforcement mode' + dontaudit:'disable/enable dontaudit rules in policy' + ibpkey:'manage infiniband pkey type definitions' + ibendport:'manage infiniband end port type definitions' + ) + + _describe -t commands command subcmds + return + ;; + option-or-argument) + (( $#words > 2 )) && ign='!' || ign='' + curcontext=${curcontext%:*}-$line[1]: + args=( + "${ign}(-)"{-h,--help}'[display help information]' + '(-S --store)'{-S+,--store=}'[select an alternate SELinux Policy Store to manage]:store:_files' + ) + + case $line[1] in + ^export) + args+=( '(-N --noreload)'{-N,--noreload}"[don't reload policy after commit]" ) + ;| + boolean|fcontext|ibendport|ibpkey|interface|login|module|node|port|user) + args+=( '(-C --locallist)'{-C,--locallist}'[list local customizations]' ) + ;| + boolean|fcontext|ibendport|ibpkey|interface|login|module|node|permissive|port|user) + args+=( + '(-n --noheading)'{-n,--noheading}"[don't print list heading]" + '(-l --list)'{-l,--list}'[list records]' + '(-E --extract)'{-E,--extract}'[extract customizable commands, for use within a transaction]' + ) + ;| + boolean|dontaudit|export|import) + args+=( '(-a --add)'{-a,--add}'[add a record]' ) + ;| + boolean|fcontext|ibendport|ibpkey|interface|login|node|permissive|port|user) + args+=( + '(-d --delete)'{-d,--delete}'[delete a record]' + '(-D --deleteall)'{-D,--deleteall}'[remove all local customizations]' + ) + ;| + boolean|fcontext|ibendport|ibpkey|interface|login|node|port|user) + args+=( '(-m --modify)'{-m,--modify}'[modify a record]' ) + ;| + fcontext|login) + args+=( '(-s --seuser)'{-s+,--seuser=}'[SELinux user name]:seuser:_selinux_users' ) + ;| + fcontext|ibendport|ibpkey|interface|node|port) + args+=( '(-t --type)'{-t+,--type=}'[SELinux Type for the object]:type:_selinux_contexts -a file_type' ) + ;| + fcontext|ibendport|ibpkey|interface|login|node|port|user) + args+=( '(-r --range)'{-r+,--range=}'[specify MLS/MCS Security Range]:range' ) + ;| + + import) + args+=( '(-f --input_file)'{-f+,--input_file=}'[specify input file]:input file:_files' ) + ;; + export) + args+=( '(-f --output_file)'{-f+,--output_file=}'[specify output file]:output_file' ) + ;; + login) + args+=( '(-l --list)1: :{ compset -P % && _groups || _users }' ) + ;; + user) + args+=( + '(-L --level)'{-L,--level}'[default SELinux Level for SELinux user, s0 Default. (MLS/MCS Systems only)]:level' + \*{-R,--roles}'[specify SELinux Roles]:roles:_selinux_roles' + ': :_selinux_users' + ) + ;; + port) + args+=( + '(-p --proto)'{-p+,--proto=}'[specify protocol for the specified port]:protocol:(tcp udp dccp sctp)' + ': :_ports' + ) + ;| + interface) + args+=( ': :_selinux_interfaces' ) + ;; + module) + args+=( + '(-P --priority)'{-P+,--priority=}'[select a priority for module operations]:priority [400]' + '(-E --extract)'{-E,--extract}'[extract customizable commands, for use within a transaction]' + '(-a --add)'{-a,--add}'[add a module]:module name:_selinux_modules' + '(-r --remove)'{-r,--remove}'[remove a module]:module name:_selinux_modules' + '(-d --disable)'{-d,--disable}'[disable a module]:module name:_selinux_modules' + '(-e --enable)'{-e,--enable}'[enable a module]:module name:_selinux_modules' + ) + ;; + node) + args+=( + '(-p --proto)'{-p+,--proto=}'[specify protocol for the specified node]:protocol:(ipv4 ipv6)' + '(-M --netmask)'{-M+,--netmask=}'[specify network mask]:netmask' + ':node:' + ) + ;; + fcontext) + args+=( + '(-e --equal)'{-e+,--equal=}'[substitute target path with sourcepath when generating default label]:equal' + '(-f --ftype)'{-f+,--ftype=}'[specify file type]:file type:(( + f\:regular\ file + d\:directory + c\:character\ device + b\:block device + s\:socket + l\:symbolic\ link + p\:named\ pipe))' + ':file spec (regex):_files' + ) + ;; + boolean) + args+=( + '(-)'{-1,--on}'[enable]' + '(-)'{-0,--off}'[disable]' + ':boolean:_selinux_bools' + ) + ;; + permissive) + args+=( '1:type:_selinux_types' ) + ;; + dontaudit) + args+=( '1:value:(on off)' ) + ;; + ibpkey) + args+=( + '(-x --subnet_prefix)'{-x,--subnet_prefix}'[specify subnet prefix for the specified infiniband ibpkey]:subnet prefix' + ':pkey:' + ) + ;; + ibendport) + args+=( + '(-z --ibdev_name)'{-z+,--ibdev_name=}'[specify name for the specified infiniband end port]:ibdev name' + ) + ;; + esac + ;; + esac + ;; + + semodule) + args=( + \*{-R,--reload}'[force a reload of policy]' + \*{-B,--build}'[build and reload policy]' + \*'--refresh[like --build but reuse existing linked policy if module files unchanged]' + \*{-D,--disable_dontaudit}'[remove dontaudits from policy]' + \*{-i+,--install=}'[install a new module]:module package:_files -g "*.pp(-.)"' + \!{-b,--base,-u,--upgrade}':module package:_files -g "*.pp(-.)"' + \*{-r+,--remove=}'[remove existing module at desired priority]:module name:_selinux_modules' + \*{-l+,--list-modules=-}'[display list of installed modules]::kind:(( + standard\:highest\ priority,\ enabled\ modules + full\:list\ all\ modules + ))' + \*{-X+,--priority=}'[set priority for following operations]:priority (1-999)' + \*{-e,--enable=}'[enable module]:module name:_selinux_modules' + \*{-d,--disable=}'[disable module]:module name:_selinux_modules' + \*{-E,--extract=}'[extract module]:module name:_selinux_modules' + '(-s --store)'{-s+,--store=}'[name of the store to operate on]:store' + '(-N -n --noreload)'{-N,-n,--noreload}"[don't reload policy after commit]" + '(-v --verbose)'{-v,--verbose}'[be verbose]' + '(-P --preserve_tunables)'{-P,--preserve_tunables}'[preserve tunables in policy]' + '(-C --ignore-module-cache)'{-C,--ignore-module-cache}'[rebuild CIL modules compiled from HLL files]' + '(-p --path)'{-p,--path}'[use an alternate path for the policy root]' + '(-S --store-path)'{-S+,--store-path=}'[use an alternate path for the policy store root]:path:_directories' + '(-c --cil)'{-c,--cil}'[extract module as cil; only affects module extraction]' + '(-H --hll)'{-H,--hll}'[extract module as hll; only affects module extraction]' + '(-m --checksum)'{-m,--checksum}'[add SHA256 checksum of modules to the list output]' + '!(--refresh)--rebuild-if-modules-changed' + "${ign}(-)"{-h,--help}'[display help information]' + ) + ;; + + semodule_unpackage) + args=( + ':pp file:_files -g "*.pp(-.)"' + ':mod file:_files -g "*.mod(-.)"' + ':fc file:_files -g "*.fc(-.)"' + ) + ;; + + sepolgen) + args=( $sepolgen ) + ;; + sepolicy) + _arguments -C \ + '-P+[specify policy to examine]' \ + "${ign}(- 1)-h[display help information]" \ + '1:command:(( + booleans\:"get description of booleans" + communicate\:"query if domains can communicate with each other" + generate\:"generate policy module template" + gui\:"graphical user interface for policies" + interface\:"list policy interfaces" + manpage\:"generate man pages for policies" + network\:"query policy network information" + transition\:"query policy to see how a source process domain can transition to the target process domain"))' \ + '*::: := ->option-or-argument' && ret=0 + case $state in + option-or-argument) + curcontext=${curcontext%:*}-$line[1]: + args=( '(-)'{-h,--help}'[display help information]' ) + case $line[1] in + transition|communicate) + args+=( + '(-s --source)'{-s+,--source=}'[specify source domain]:source:_selinux_types -a domain' + '(-t --target)'{-t+,--target=}'[specify target domain]:target:_selinux_types -a domain' + ) + ;| + manpage|network) + args+=( + {-d,--domain}'[specify domain]:*: :_selinux_types -a domain' + '!*'{-d-,--domain=-}': :_selinux_types -a domain' + ) + ;| + booleans) + args+=( + '(-)'{-a,--all}'[get all booleans descriptions]' + \*{-b,--boolean}'[specify boolean to show description]:*:boolean:_selinux_bools' + '!(-a --all -h --help)*'{-b-,--boolean=}': :_selinux_bools' + ) + ;; + communicate) + args+=( + '(-c --class)'{-c+,--class=}'[specify class to use for communications]:tclass [file]:_selinux_classes' + '(-S --sourceaccess)'{-S+,--sourceaccess=}'[specify permissions for the source type to use]:source access [open,write]' + '(-T --targetaccess)'{-T+,--targetaccess=}'[specify permissions for the target type to use]:target access [open,read]' + ) + ;; + generate) + args=( $sepolgen ) + ;; + interface) + args+=( + '(-c --compile)'{-c,--compile}'[run compile test for selected interface]' + '(-v --verbose)'{-v,--verbose}'[show verbose information]' + '(-f --file)'{-f+,--file=}'[specify interface file]:interface file:_files' + '(-a --list_admin)'{-a,--list_admin}'[list all domains with admin interface - DOMAIN_admin()]' + '(-u --list_user)'{-u,--list_user}'[list all domains with SELinux user role interface - DOMAIN_role()]' + '(-l --list)'{-l,--list}'[list all interfaces]' + {-i,--interfaces}'[specify interface names]:*:interface:_selinux_interfaces' + '!*'{-i-,--interfaces=-}':interface:_selinux_interfaces' + ) + ;; + manpage) + args+=( + '(-p --path)'{-p+,--path=}'[specify path in which the generated selinux man pages will be stored]:path:_directories' + '(-o --os)'{-o+,--os=}'[specify name of the OS for man pages]:OS' + '(-w --web)'(-w,--web)'[generate HTML man pages structure]' + '(-r --root)'{-r+,--root=}'[specify alternate root directory]:root [/]:_directories' + '--source_files[alternative root path needs to include file context files and policy.xml file]' + '(-a --all -d --domain)'{-a,--all}'[all domains]' + ) + ;; + network) + args+=( + '(-l --list)'{-l,--list}'[list all SELinux port types]' + {-p,--port}'[specify type related to the port]:*:port number' + '!*'{-p-,--port=-}':port number' + {-t,--type}'[show ports defined for this SELinux type]:*:port type:_selinux_types -a port_type' + '!*'{-t-,--type=-}':port type:_selinux_types -a port_type' + {-d,--domain}'[specify domain]:*:domain:_selinux_types -a domain' + '!*'{-d-,--domain=-}':domain:_selinux_types -a domain' + {-a,--application}'[show ports to which this application can bind and/or connect]:*:application:_selinux_types -a application_domain_type' + '!*'{-a-,--application=-}':domain:_selinux_types -a application_domain_type' # am not sure this is what is meant by applications + ) + ;; + esac + ;; + esac + ;; + + sesearch) + args=( + "${ign}(-h --help)"{-h,--help}'[display help information]' + "${ign}--version[display version information]" + '(-v --verbose)'{-v,--verbose}'[print extra informational messages]' + '--debug[enable debugging]' + '-A[search allow and allowxperm rules]' + '--allow[search allow rules]' + '--allowxperm[search allowxperm rules]' + '--auditallow[search auditallow rules]' + '--auditallowxperm[search auditallowxperm rules]' + '--dontaudit[search dontaudit rules]' + '--dontauditxperm[search dontauditxperm rules]' + '--neverallow[search neverallow rules]' + '--neverallowxperm[search neverallowxperm rules]' + '(-T --type_trans)'{-T,--type_trans}'[search type_transition rules]' + '--type_change[search type_change rules]' + '--type_member[search type_member rules]' + '--role_allow[find role allow rules]' + '--role_trans[find range_transition rules]' + '--range_trans[search range_transition rules]' + '(-s --source)'{-s+,--source=}'[source type/role of the TE/RBAC rule]: : _alternative + "types\:type\:_selinux_types" + "roles\:role\:_selinux_attributes"' + '(-t --target)'{-t+,--target=}'[target type/role of the TE/RBAC rule]: : _alternative + "types\:type\:_selinux_types" + "roles\:role\:_selinux_attributes"' + '(-c --class)'{-c+,--class=}'[comma separated list of object classes]:class:_sequence _selinux_classes' + '(-p --perms)'{-p+,--perms=}'[comma separated list of permissions]: :_sequence _selinux_permissions' + '(-x --xperms)'{-x+,--xperms=}'[comma separated list of extended permissions]:xperms' + '(-D --default)'{-D+,--default=}'[default of the rule. (type/role/range transition rules]:default' + '(-b --bool)'{-b+,--bool=}'[comma separated list of Booleans in the conditional expression]:bool ' + '-eb[match Boolean list exactly instead of matching any listed boolean]' + '-ep[match permission set exactly instead of matching any listed permission]' + '-ex[match extended permission set exactly instead of matching any listed permission]' + '-Sp[match rules where the listed permissions are a subset of the rule permissions]' + '-ds[match source attributes directly instead of matching member types/roles]' + '-dt[match target attributes directly instead of matching member types/roles]' + '-rs[use regular expression matching for the source type/role]' + '-rt[use regular expression matching for the target type/role]' + '-rc[use regular expression matching for the object class]' + '-rd[use regular expression matching for the default type/role]' + '-rb[use regular expression matching for booleans]' + ':policy:_files' + ) + ;; + + sestatus) + args=( '-b[booleans]' '-v[contexts of files and processes listed in the /etc/sestatus.conf]' ) + ;; + + setenforce) + _alternative \ + 'enable-args:enable:(Enforcing 1)' \ + 'disable-args:disable:(Permissive 0)' + return + ;; + + setsebool) + args=( + '-P[make changes persistent by writing pending values to disk]' + "-N[don't reload policy from disk]" + '-V[print verbose error messages]' + ':boolean:_selinux_bools' + ': : _values value + {1,on}"[enable]" + {0,off}"[disable]"' + ) + ;; + + validatetrans) + args=( + ':source context:_selinux_contexts' + ':target context:_selinux_contexts' + ':class:_selinux_classes' + ':new context:_selinux_contexts' + ) + ;; +esac + +_arguments -s $args diff --git a/Completion/Linux/Command/_setpriv b/Completion/Linux/Command/_setpriv index 9e38152b9..8b8d99785 100644 --- a/Completion/Linux/Command/_setpriv +++ b/Completion/Linux/Command/_setpriv @@ -93,7 +93,7 @@ _arguments -C -S -s \ '--reuid[set real and effective UNIX user id]:UNIX user:_users' \ '--securebits[set "process securebits"]: : _sequence __setpriv_prctl_securebits_set_elements' \ '--pdeathsig[keep, clear, or set parent death signal]: : __setpriv_death_signals' \ - '--selinux-label[request a selinux label]:SELinux labels: ' \ + '--selinux-label[request a selinux label]:SELinux label:_selinux_contexts' \ '--apparmor-profile[request an apparmor profile]:AppArmor profiles: ' \ '--reset-env[set environment as for a classic login shell]' \ '*:::command: _normal -p $service' \ diff --git a/Completion/Linux/Type/_selinux_contexts b/Completion/Linux/Type/_selinux_contexts index 4c2cf4288..bdad8e72b 100644 --- a/Completion/Linux/Type/_selinux_contexts +++ b/Completion/Linux/Type/_selinux_contexts @@ -1,14 +1,21 @@ #autoload -local -a parts suf +local -a parts users roles types + +zparseopts -E -D a:=types P:=users + +if ! compset -S ':*'; then + users+=( -qS : ) + roles+=( -qS : ) + [[ $(/dev/null || types+=( -qS : ) +fi parts=( users roles types ) while compset -P 1 '*:' && (( $+parts[1] )) ; do shift parts done if (( $+parts[1] )); then - compset -S ':*' || suf=( -S : ) - _selinux_$parts[1] $suf + _selinux_$parts[1] ${(P)parts[1]} else _message -e selinux-ranges 'selinux range' fi diff --git a/Completion/Linux/Type/_selinux_types b/Completion/Linux/Type/_selinux_types index ef31f45d2..69047c690 100644 --- a/Completion/Linux/Type/_selinux_types +++ b/Completion/Linux/Type/_selinux_types @@ -1,7 +1,19 @@ #autoload -local -a setypes expl +# Pass -a attribute to filter types, e.g.: +# -a domain - for process types +# -a file_type - for file types +# -a port_type - for network ports + +local -a setypes expl extra + +zparseopts -E -D -a extra a: + +if (( $#extra )); then + setypes=( ${${${(f)"$(_call_program selinux-types seinfo $extra --flat -x)"}#[[:blank:]]}:1} ) +else + setypes=( ${(f)"$(_call_program selinux-types seinfo --flat -t)"} ) +fi -setypes=( ${(f)"$(_call_program selinux-types seinfo --flat -t)"} ) _description selinux-types expl "selinux type" compadd "$@" "$expl[@]" -a setypes diff --git a/Completion/Unix/Command/_cp b/Completion/Unix/Command/_cp index da9428ce3..cb899cc28 100644 --- a/Completion/Unix/Command/_cp +++ b/Completion/Unix/Command/_cp @@ -32,7 +32,7 @@ if _pick_variant gnu=GNU unix --version; then '(-v --verbose)'{-v,--verbose}'[explain what is being done]' \ '(-x --one-file-system)'{-x,--one-file-system}'[stay on this file system]' \ '(--context)-Z[set destination SELinux security context]' \ - '(-Z)--context=-[set destination SELinux security context]:: :_selinux_contexts' \ + '(-Z)--context=-[set destination SELinux security context]:: :_selinux_contexts -a file_type' \ '(- *)--help' '(- *)--version' \ '*:file or directory:_files' else diff --git a/Completion/Unix/Command/_find b/Completion/Unix/Command/_find index 560b77f7e..4f1c338ee 100644 --- a/Completion/Unix/Command/_find +++ b/Completion/Unix/Command/_find @@ -115,14 +115,14 @@ case $variant in '*-readable' '*-writable' '*-xtype:file type:((b\:block\ special\ file c\:character\ special\ file d\:directory p\:named\ pipe f\:normal\ file l\:symbolic\ link s\:socket))' - '-files0-from[start recursing from targets in given file]:NUL-separated targets file:_files' + '(*)-files0-from[start recursing from targets in given file]:NUL-separated targets file:_files' '*-fls:output file:_files' '*-fprint:output file:_files' '*-fprint0:output file:_files' '*-fprintf:output file:_files:output format' '*-printf:output format' ) - [[ $OSTYPE = linux-gnu ]] && args+=( '*-context:SELinux context (glob pattern):_selinux_contexts' ) + [[ $OSTYPE = linux-gnu ]] && args+=( '*-context:SELinux context (glob pattern):_selinux_contexts -a file_type' ) ;; esac diff --git a/Completion/Unix/Command/_install b/Completion/Unix/Command/_install index 364119961..238b8b5bc 100644 --- a/Completion/Unix/Command/_install +++ b/Completion/Unix/Command/_install @@ -25,7 +25,7 @@ if _pick_variant gnu='Free Soft' unix --version; then args+=( $common_args '(-b --backup)--backup=[create backup; optionally specify method]:: :->controls' - "${lx}--context=-[like -Z, or specify SELinux security context to set]::SELinux security context:_selinux_contexts" + "${lx}--context=-[like -Z, or specify SELinux security context to set]::SELinux security context:_selinux_contexts -a file_type" '-D[create all leading destination path components]' '(: -)--help[display help information]' "${lx}--preserve-context[preserve SELinux security context]" diff --git a/Completion/Unix/Command/_mount b/Completion/Unix/Command/_mount index 5a379b424..bf75aa118 100644 --- a/Completion/Unix/Command/_mount +++ b/Completion/Unix/Command/_mount @@ -334,9 +334,9 @@ if (( ! $+_fs_any )); then 'keybits[set number of bits in encryption key]:key size:(64 128 160 192 256)' 'offset[specify data start for loopback mount]:offset (bytes)' '(loud)silent' '(silent)loud' - '(fscontext defcontext)context:context' - '(context)'{fscontext,defcontext}':context' - 'rootcontext:context' + '(fscontext defcontext)context:context:_selinux_contexts -a file_type' + '(context)'{fscontext,defcontext}':context:_selinux_contexts -a file_type' + 'rootcontext:context:_selinux_contexts -a file_type' ) _fs_adfs=( 'uid[set owner of root]:user ID' diff --git a/Completion/Unix/Command/_zfs b/Completion/Unix/Command/_zfs index 3265e1eb8..c09435a1f 100644 --- a/Completion/Unix/Command/_zfs +++ b/Completion/Unix/Command/_zfs @@ -295,7 +295,7 @@ case $OSTYPE in linux-gnu) rw_ds_props+=( 'relatime:value:(on off)' ) ci_ds_props+=( - {,fs,def,root}'context:SELinux context:_selinux_contexts' + {,fs,def,root}'context:SELinux context:_selinux_contexts -a file_type' ) ;; esac -- cgit v1.2.3 From f3b865b9155269ba0dee7ced93b061e78df507c1 Mon Sep 17 00:00:00 2001 From: Oliver Kiddle Date: Mon, 27 Jan 2025 23:06:16 +0100 Subject: 53326: completion updates for core Linux utils --- ChangeLog | 14 ++++++++++++++ Completion/Linux/Command/_findmnt | 14 ++++++++++---- Completion/Linux/Command/_free | 1 + Completion/Linux/Command/_losetup | 3 ++- Completion/Linux/Command/_lsblk | 7 ++++++- Completion/Linux/Command/_pidof | 1 + Completion/Linux/Command/_slabtop | 2 +- Completion/Linux/Command/_wipefs | 3 ++- Completion/Unix/Command/_awk | 1 + Completion/Unix/Command/_chmod | 14 +++++++------- Completion/Unix/Command/_chown | 3 +-- Completion/Unix/Command/_cmp | 2 +- Completion/Unix/Command/_find | 1 - Completion/Unix/Command/_hexdump | 1 + Completion/Unix/Command/_last | 1 + Completion/Unix/Command/_mv | 3 ++- Completion/Unix/Command/_objdump | 6 ++++-- Completion/Unix/Command/_pgrep | 1 + Completion/Unix/Command/_ping | 5 ++++- Completion/Unix/Command/_ps | 1 + Completion/Unix/Command/_readelf | 7 +++++-- Completion/Unix/Command/_strip | 1 + Completion/Unix/Command/_uptime | 7 ++++--- Completion/Unix/Command/_w | 1 + 24 files changed, 72 insertions(+), 28 deletions(-) (limited to 'Completion/Unix/Command/_find') diff --git a/ChangeLog b/ChangeLog index 2585d50e8..c5db038e6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,19 @@ 2025-01-27 Oliver Kiddle + * 53326: Completion/Linux/Command/_findmnt, + Completion/Linux/Command/_free, Completion/Linux/Command/_losetup, + Completion/Linux/Command/_lsblk, Completion/Linux/Command/_pidof, + Completion/Linux/Command/_slabtop, Completion/Linux/Command/_wipefs, + Completion/Unix/Command/_awk, Completion/Unix/Command/_chmod, + Completion/Unix/Command/_chown, Completion/Unix/Command/_cmp, + Completion/Unix/Command/_find, Completion/Unix/Command/_hexdump, + Completion/Unix/Command/_last, Completion/Unix/Command/_mv, + Completion/Unix/Command/_objdump, Completion/Unix/Command/_pgrep, + Completion/Unix/Command/_ping, Completion/Unix/Command/_ps, + Completion/Unix/Command/_readelf, Completion/Unix/Command/_strip, + Completion/Unix/Command/_uptime, Completion/Unix/Command/_w: + completion updates for core Linux utils + * 53325: Completion/BSD/Command/_acpiconf, Completion/BSD/Command/_bsdconfig, Completion/BSD/Command/_pkgin, Completion/BSD/Command/_procstat, Completion/BSD/Command/_sockstat, diff --git a/Completion/Linux/Command/_findmnt b/Completion/Linux/Command/_findmnt index b29372c39..6155d4dc1 100644 --- a/Completion/Linux/Command/_findmnt +++ b/Completion/Linux/Command/_findmnt @@ -8,6 +8,7 @@ # local curcontext=$curcontext state state_descr line ret=1 typeset -A opt_args +local -a suf dedup _arguments -s -C \ '(H -A --all)'{-A,--all}'[print all filesystems]' \ @@ -45,6 +46,7 @@ _arguments -s -C \ '(H)2:: :->targets' \ + '(format)' \ '(H)'{-D,--df}'[imitate the output of df command]' \ + '(H)'{-I,--dfi}'[imitate the output of df with -i option]' \ '(H)'{-J,--json}'[use JSON output format]' \ '(H)'{-l,--list}'[use list output format]' \ '(H)'{-P,--pairs}'[use key="value" output format]' \ @@ -55,6 +57,7 @@ _arguments -s -C \ '(H)'{-N+,--task=}'[search /proc//mountinfo]: :_pids' \ '(H)'{-s,--fstab}'[search in /etc/fstab]' \ + '(H)' \ + '(* -)'{-H,--list-columns}'[list available columns]' \ '(- :)'{-h,--help}'[display help text and exit]' \ '(- :)'{-V,--version}'[display version and exit]' \ && ret=0 @@ -66,13 +69,16 @@ __findmnt_mountpoints () { case $state in columns) + dedup=( ${(Ms.,.)${PREFIX#+}##*,} ${(Ms.,.)SUFFIX%%,*} ) + suf=( -qS , ) + compset -S ',*' && suf=() compset -P '+' || _describe -t list-prefixes prefix \ - '( +:"not replace but extend the list" )' -S '' && ret=0 + '( +:"not replace but extend the list" )' -S '' && ret=0 + compset -P '*,' local -a columns=( - ${${${(f)"$(_call_program columns findmnt -h)"}[(r)Available*,-2]}[2,-1]} + ${${${${(f)"$(_call_program columns findmnt --list-columns)"}## #}//:/\\:}/ <[^>]#> #/:} ) - columns=( ${${${${${${columns## #}//:/\\:}//\[/\\[}//]/\\]}/ /[}/%/]} ) - _values -s , -M 'm:{a-z}={A-Z}' column $columns && ret=0 + _describe -t fields column columns -M 'm:{a-z}={A-Z}' $suf -F dedup && ret=0 ;; *) # call "findmnt $opts" to get possible sources/targets local opts='-lnve' diff --git a/Completion/Linux/Command/_free b/Completion/Linux/Command/_free index a0da97446..376b8a21f 100644 --- a/Completion/Linux/Command/_free +++ b/Completion/Linux/Command/_free @@ -2,6 +2,7 @@ _arguments -s \ '(-l --lohi)'{-l,--lohi}'[show detailed low and high memory statistics]' \ + '(-L --line)'{-L,--line}'[show output on a single line]' \ '(-t --total)'{-t,--total}'[show total for RAM + swap]' \ '(-v --committed)'{-v,--committed}'[show committed memory and commit limit]' \ '(-w --wide)'{-w,--wide}'[wide mode]' \ diff --git a/Completion/Linux/Command/_losetup b/Completion/Linux/Command/_losetup index f5a7ec1b1..d8e792aaf 100644 --- a/Completion/Linux/Command/_losetup +++ b/Completion/Linux/Command/_losetup @@ -18,7 +18,7 @@ _arguments -s -S \ - 'info' \ '(-v --verbose)'{-v,--verbose}'[verbose mode]' \ '(-o --offset -a --all)'{-a,--all}'[show the status of all loop devices]' \ - '(-O --output --output-all)'{-O+,--output=}'[specify columns to be printed with --list]:column:_sequence -s , compadd - name autoclear back-file back-ino back-maj\:min maj\:min offset partscan ro sizelimit dio log-sec' \ + '(-O --output --output-all)'{-O+,--output=}'[specify columns to be printed with --list]:column:_sequence -s , compadd -M "B\:+=" - name autoclear back-file back-ino back-maj\:min back-maj back-min maj\:min maj min offset partscan ref ro sizelimit dio log-sec' \ '(-O --output)--output-all[output all columns]' \ '(-J --json --raw -O --output -n --noheadings)'{-J,--json}'[use JSON --list output format]' \ '(-l --list)'{-l,--list}'[list currently used loop devices]' \ @@ -33,6 +33,7 @@ _arguments -s -S \ {-D,--detach-all}'[detach all associated loop devices]' \ - 'create' \ '--direct-io[open backing file with O_DIRECT]::enable:(on off)' \ + '--loop-ref=[specify loop device reference]:string' \ '(-f --find 1)'{-f,--find}'[find the first unused loop device]' \ '(-L --nooverlap)'{-L,--nooverlap}'[avoid possible conflict between devices]' \ '(-P --partscan)'{-P,--partscan}'[scan the partition table of newly created loop devices]' \ diff --git a/Completion/Linux/Command/_lsblk b/Completion/Linux/Command/_lsblk index 63aac743c..c8b30eb5e 100644 --- a/Completion/Linux/Command/_lsblk +++ b/Completion/Linux/Command/_lsblk @@ -8,6 +8,10 @@ typeset -A opt_args _arguments -C -s -S \ '(H -A --noempty)'{-A,--noempty}"[don't print empty devices]" \ '(H -E --dedup)'{-E+,--dedup=}'[de-duplicate output by specified column]:column:->columns' \ + '(H -Q --filter)'{-Q+,--filter=}'[only print lines matching expression]:expression' \ + '(H)--highlight=[color lines matching expression]:expression' \ + '(H)*--ct-filter=[restrict the next counter]:expression' \ + '(H)*--ct=[define a custom counter]:name\:param\:func' \ '(H -a --all)'{-a,--all}'[print all devices]' \ '(H -b --bytes)'{-b,--bytes}'[print size in bytes rather than in human readable format]' \ '(H -d --nodeps)'{-d,--nodeps}"[don't print slaves or holders]" \ @@ -40,6 +44,7 @@ _arguments -C -s -S \ '(H)'{-P,--pairs}'[use key="value" output format]' \ '(H)'{-r,--raw}'[use raw output format]' \ + 'H' \ + '(* -)'{-H,--list-columns}'[list the available columns]' \ '(* -)'{-h,--help}'[display help information]' \ '(* -)'{-V,--version}'[display version information]' && ret=0 @@ -56,7 +61,7 @@ case $state in ;| column*) values=( - ${${${${(f)"$(_call_program columns lsblk -h)"}[(r)Available*,-2]## #}[2,-1]//:/\\:}/ /:} + ${${${${(f)"$(_call_program columns lsblk --list-columns)"}## #}//:/\\:}/ <[^>]#> #/:} ) _describe -t fields column values -M 'm:{a-z}={A-Z}' $suf -F dedup && ret=0 ;; diff --git a/Completion/Linux/Command/_pidof b/Completion/Linux/Command/_pidof index 151a0e0f6..fdafd507d 100644 --- a/Completion/Linux/Command/_pidof +++ b/Completion/Linux/Command/_pidof @@ -17,6 +17,7 @@ case $variant in '(-w --with-workers)'{-w,--with-workers}'[show kernel workers too]' \ "(-x $exargs)"-x'[include shells running named scripts]' \ "($exargs)"\*{-o+,--omit-pid=}'[omit processes with PIDs]:pids:_sequence -s , _pids' \ + '(-t --lightweight)'{-t,--lightweight}'[list threads too]' \ '(-S --separator)'{-S+,--separator=}'[specify separator put between PIDs]:separator' \ '*:process:->procnames' \ && return 0 diff --git a/Completion/Linux/Command/_slabtop b/Completion/Linux/Command/_slabtop index 5c8919d12..2021ec332 100644 --- a/Completion/Linux/Command/_slabtop +++ b/Completion/Linux/Command/_slabtop @@ -1,5 +1,4 @@ #compdef slabtop -# based on procps-ng-3.3.15 local -a criteria=( 'a:number of active objects' @@ -18,5 +17,6 @@ _arguments -s \ '(-d --delay -o --once)'{-d+,--delay=}'[specify the delay between updates]:seconds: ' \ '(-s --sort)'{-s+,--sort=}'[specify the sort criteria]:criteria:(($criteria))' \ '(-d --delay -o --once)'{-o,--once}'[display the output once and exit]' \ + '--human[show human-readable output]' \ '(-)'{-V,--version}'[display version information and exit]' \ '(-)'{-h,--help}'[display usage information and exit]' diff --git a/Completion/Linux/Command/_wipefs b/Completion/Linux/Command/_wipefs index 8642aab92..5cc97e85f 100644 --- a/Completion/Linux/Command/_wipefs +++ b/Completion/Linux/Command/_wipefs @@ -2,7 +2,8 @@ _arguments -s -S \ '(H -a --all)'{-a,--all}'[wipe all magic strings]' \ - '(H -b --backup)'{-b,--backup}'[create a signature backup in $HOME]' \ + '(H --backup)-b[create a signature backup in $HOME]' \ + '(H -b)--backup=-[create a signature backup in $HOME]::path [$HOME]:_directories' \ '(H -f --force)'{-f,--force}'[force erasure]' \ '(H -i --no-headings -J --json -p --parsable)'{-i,--no-headings}"[don't print headings]" \ '(H -J --json -i --no-headings -p --parsable)'{-J,--json}'[use JSON output format]' \ diff --git a/Completion/Unix/Command/_awk b/Completion/Unix/Command/_awk index b69cc5cf8..694749d7d 100644 --- a/Completion/Unix/Command/_awk +++ b/Completion/Unix/Command/_awk @@ -51,6 +51,7 @@ case $variant in {-g,--gen-pot}'[scan awk program and generate .po file on stdout]' '*'{-i+,--include}'[load source library]:library file:->script' {-I,--trace}'[print internal byte code names as they are executed]' + '(-k --csv)'{-k,--csv}'[enable CSV special processing]' '*'{-l+,--load}'[load dynamic extension]:extension:->extension' {-M,--bignum}'[select arbitrary-precision arithmetic on numbers]' {-o-,--pretty-print=-}'[pretty-print awk program]::output file:_files' diff --git a/Completion/Unix/Command/_chmod b/Completion/Unix/Command/_chmod index 693f348dc..5ec60d707 100644 --- a/Completion/Unix/Command/_chmod +++ b/Completion/Unix/Command/_chmod @@ -19,6 +19,13 @@ case "$variant" in '*: :->files' ) ;; + gnu|freebsd*|openbsd*|netbsd*|darwin*|dragonfly*) + args+=( + '(-H -L -P)-L[follow all symlinks]' + '(-H -L -P)-H[follow symlinks on the command line]' + '(-H -L -P)-P[do not follow symlinks (default)]' + ) + ;| gnu) aopts=() args+=( @@ -49,13 +56,6 @@ case "$variant" in '-h[operate on symlinks themselves]' ) ;| - freebsd*|openbsd*|netbsd*|darwin*|dragonfly*) - args+=( - '(-H -L -P)-L[follow all symlinks]' - '(-H -L -P)-H[follow symlinks on the command line]' - '(-H -L -P)-P[do not follow symlinks (default)]' - ) - ;| darwin*) args+=( '(1)-C[return false if any specified files have ACLs]' diff --git a/Completion/Unix/Command/_chown b/Completion/Unix/Command/_chown index bcc6aec2f..c9fe8fadd 100644 --- a/Completion/Unix/Command/_chown +++ b/Completion/Unix/Command/_chown @@ -13,6 +13,7 @@ case "$variant" in '(-h --no-dereference)--dereference[dereference symlinks]' '(-h --no-dereference --dereference)'{-h,--no-dereference}'[operate on symlinks themselves]' '(-f --silent --quiet)'{-f,--silent,--quiet}"[don't report errors]" + '--from=[restrict changes to files by current ownership]: :->owner' '--preserve-root[fail to operate recursively on /]' '--reference=[copy ownership of specified file]:file:_files' '(-R --recursive)'{-R,--recursive}'[change files and directories recursively]' @@ -22,8 +23,6 @@ case "$variant" in '(- : *)--help[display help information]' '(- : *)--version[display version information]' ) - [[ $service = chown ]] && - args+=( '--from=[restrict changes to files by current ownership]: :->owner' ) ;; *) args=( diff --git a/Completion/Unix/Command/_cmp b/Completion/Unix/Command/_cmp index 20d309e32..d0a4caa41 100644 --- a/Completion/Unix/Command/_cmp +++ b/Completion/Unix/Command/_cmp @@ -15,7 +15,7 @@ case $variant in units=":_numbers -u bytes offset K M G T P E Z Y" ;| gnu) - args=( + args+=( '(- *)'{-v,--version}'[display version information]' '(- *)--help[display help information]' ) diff --git a/Completion/Unix/Command/_find b/Completion/Unix/Command/_find index 4f1c338ee..95e4fac4e 100644 --- a/Completion/Unix/Command/_find +++ b/Completion/Unix/Command/_find @@ -109,7 +109,6 @@ case $variant in '-regextype:regexp syntax:(help findutils-default awk egrep ed emacs gnu-awk grep posix-awk posix-basic posix-egrep posix-extended posix-minimal-basic sed)' '*-warn' '*-nowarn' - '*-xautofs' '*-used:access after inode change (days)' '*-executable' '*-readable' diff --git a/Completion/Unix/Command/_hexdump b/Completion/Unix/Command/_hexdump index f700ca683..140422ac1 100644 --- a/Completion/Unix/Command/_hexdump +++ b/Completion/Unix/Command/_hexdump @@ -25,6 +25,7 @@ if [[ $OSTYPE = linux* ]]; then '(- *)'{-h,--help}'[display usage information]' '(- *)'{-V,--version}'[display version information]' ) + fmts+=( {--one-byte-hex,-X}'[one-byte hexadecimal display]' ) else # strip long options by taking every second element print -v fmts -f '%2$s' -- "$fmts[@]" diff --git a/Completion/Unix/Command/_last b/Completion/Unix/Command/_last index d76260c36..240b96e67 100644 --- a/Completion/Unix/Command/_last +++ b/Completion/Unix/Command/_last @@ -41,6 +41,7 @@ case $OSTYPE in '(-R --nohostname)'{-R,--nohostname}'[suppress display of hostname field]' '(-s --since)'{-s+,--since=}'[display lines since the specified time]:time (YYYYMMDDhhmmss)' '(-t --until)'{-t+,--until=}'[display lines until the specified time]:time (YYYYMMDDhhmmss)' + '(-T --tab-separated)'{-T,--tab-separated}'[use tabs as delimiters]' '(-p --present)'{-p+,--present=}'[display who were present at the specified time]:time (YYYYMMDDhhmmss)' '(-w --fullnames)'{-w,--fullnames}'[show full user and domain names]' '(-x --system)'{-x,--system}'[display shutdown/runlevel entries]' diff --git a/Completion/Unix/Command/_mv b/Completion/Unix/Command/_mv index 983c25ea8..e9227c334 100644 --- a/Completion/Unix/Command/_mv +++ b/Completion/Unix/Command/_mv @@ -14,6 +14,7 @@ case $variant; in {simple,never}"[always make simple backups]"' '(-b --backup -n --no-clobber)-b[make a backup of each existing destination file]' '(-v)--debug[explain how a file is copied]' + '--exchange[exchange source and destination]' '(-f --force -i --interactive -n --no-clobber)'{-f,--force}"[don't prompt before overwriting]" '(-f --force -i --interactive -n --no-clobber)'{-i,--interactive}'[prompt before overwriting existing file]' '(-f --force -i --interactive -n --no-clobber)'{-n,--no-clobber}"[don't overwrite existing file]" @@ -22,7 +23,7 @@ case $variant; in '(-S --suffix)'{-S+,--suffix=}'[specify the backup suffix]:backup suffix [~]' '(-t --target-directory)'{-t+,--target-directory=}'[move all source arguments into specified directory]:directory:_directories' '(-T --no-target-directory)'{-T,--no-target-directory}'[treat final argument as a normal file]' - '(-u)--update=-[move only when destination file is older or missing]::update files [older]:(all none older)' + '(-u)--update=-[move only when destination file is older or missing]::update files [older]:(all none none-fail older)' '(--update)-u[move only when destination file is older or missing]' '(-v --verbose)'{-v,--verbose}'[show file names after they are moved]' '(- *)--help[display usage information]' diff --git a/Completion/Unix/Command/_objdump b/Completion/Unix/Command/_objdump index 94c01eb83..71a615c97 100644 --- a/Completion/Unix/Command/_objdump +++ b/Completion/Unix/Command/_objdump @@ -32,6 +32,7 @@ case $variant in '(-D --disassemble-all)'{-D,--disassemble-all}'[display assembler contents of all sections]' '(-S --source)'{-S,--source}'[intermix source code with disassembly]' '--source-comment=-[prefix lines of source code with specified text]::text prefix [# ]' + '(-Z --decompress)'{-Z,--decompress}'[decompress section(s) before displaying their contents]' '(-g --debugging)'{-g,--debugging}'[display debug information in object file]' '(-e --debugging-tags)'{-e,--debugging-tags}'[display debug information using ctags style]' '(-G --stabs)'{-G,--stabs}'[display (in raw form) any STABS info in the file]' @@ -176,13 +177,14 @@ case "$state" in 'O[str-offsets]' \ "o[loc]" "R[ranges]" "t[pubtypes]" "U[trace_info]" "u[trace_abbrev]" \ "T[trace_aranges]" "g[gdb_index]" "A[addr]" "c[cu_index]" "k[links]" \ - "K[follow-links]" && ret=0 + "K[follow-links]" "D[use-debuginfod]" "E[do-not-use-debuginfod]" && ret=0 ;; dwarf-names) _sequence _wanted dwarf-sections expl "dwarf section" compadd - \ rawline decodedline info abbrev pubnames aranges macro frames \ frames-interp str str-offsets loc Ranges pubtypes gdb_index trace_info \ - trace_abbrev trace_aranges addr cu_index links follow-links && ret=0 + trace_abbrev trace_aranges addr cu_index links follow-links \ + use-debuginfod do-not-use-debuginfod && ret=0 ;; bfdnames) _wanted targets expl target compadd - \ diff --git a/Completion/Unix/Command/_pgrep b/Completion/Unix/Command/_pgrep index 94c1dae1a..798b6d6d4 100644 --- a/Completion/Unix/Command/_pgrep +++ b/Completion/Unix/Command/_pgrep @@ -48,6 +48,7 @@ arguments=( '--cgroup=[match by cgroup v2 names]:cgroup' '--ns=[match only on same namespaces as specified PID]: :_pids' '--nslist=[match only on specified namespaces (with --ns)]:namespace:(ipc mnt net pid user uts)' + '*--env=[match on environment variable]:var[=value]:_parameters -g "*export*" -qS=' '(: * -)'{-V,--version}'[display version information]' '-z+[match only on specified zone IDs]:zone:_sequence _zones' ) diff --git a/Completion/Unix/Command/_ping b/Completion/Unix/Command/_ping index 84bd76b82..95e1fd604 100644 --- a/Completion/Unix/Command/_ping +++ b/Completion/Unix/Command/_ping @@ -196,6 +196,7 @@ case ${variant}:${${service#ping}:-4} in ;; iputils:*) args+=( + '-3[RTT precision (do not round up the result time)]' '-A[adaptive]' '-b[allow pinging a broadcast address]' "-B[don't allow ping to change source address]" @@ -204,12 +205,14 @@ case ${variant}:${${service#ping}:-4} in '-e+[define identifier for ping session]:identifier' '(-4)-F+[allocate and set 20-bit flow label]:flow label (hex)' '(-)-h[show usage information]' + '(-n)-H[force reverse DNS name resolution even for numeric destination]' '-I+[specify source interface]:interface:_net_interfaces' '-m+[specify mark to tag outgoing packets]:mark' "-M+[specify path MTU discovery strategy]:strategy:(( do\:prohibit\ fragmentation,\ even\ local\ one want\:do\ PMTU\ discovery - dont\:don\'t\ set\ DF\ flag))" + dont\:don\'t\ set\ DF\ flag + probe\:set\ DF\ flag\ and\ bypass\ PMTU\ checks))" '(-4)-N+[send ICMPv6 node information queries instead of echo request]:sub option' '-O[report outstanding ICMP ECHO reply before sending next packet]' '-Q+[set Quality of Service-related bits in ICMP datagrams]:QoS TOS bits' diff --git a/Completion/Unix/Command/_ps b/Completion/Unix/Command/_ps index 158fb6b83..7d83f90ea 100644 --- a/Completion/Unix/Command/_ps +++ b/Completion/Unix/Command/_ps @@ -172,6 +172,7 @@ case $OSTYPE in '--headers[repeat header lines, one per page of output]' '(--cols --columns --width)'{--cols,--columns,--width}'[set screen width]:width' '(--lines --rows)'{--lines,--rows}'[set screen height]' + '--signames[display signal masks using signal names]' '--cumulative[include child process data with the parent]' '-n[set namelist file for WCHAN display]:file:_files' '(--no-headers --no-heading)'{--no-headers,--no-heading}'[suppress headers]' diff --git a/Completion/Unix/Command/_readelf b/Completion/Unix/Command/_readelf index b3abdf0a5..43cbc81c6 100644 --- a/Completion/Unix/Command/_readelf +++ b/Completion/Unix/Command/_readelf @@ -19,8 +19,8 @@ args=( '(-D --use-dynamic)'{-D,--use-dynamic}'[use dynamic section info when showing symbols]' \*{-x,--hex-dump=}"[dump contents of specified section as bytes]:section:($sections)" \*{-p,--string-dump=}"[dump contents of specified section as strings]:section:($sections)" - '-w+[show the contents of DWARF2 debug sections]::debug section:(a A r c L f F g i o m p t R l s O u T U k K N)' - '--debug-dump=[show the contents of DWARF2 debug sections]::section:(abbrev addr aranges cu_index decodedline frames frames-interp gdb_index info loc macro pubnames pubtypes Ranges rawline str str-offsets trace_abbrev trace_aranges trace_info links follow-links no-follow-links)' + '*-w+[show the contents of DWARF2 debug sections]::debug section:(a A r c f F g i k K N D E l L m o O p r R s t T u U)' + '*--debug-dump=[show the contents of DWARF2 debug sections]::section:(abbrev addr cu_index frames frames-interp gdb_index info links follow-links no-follow-links use-debuginfod do-not-use-debuginfod rawline decodedline macro loc str-offsets pubnames aranges Ranges str pubtype trace_aranges trace_abbrev trace_info)' '(-P --process-links)'{-P,--process-links}'[display the contents of non-debug sections in separate debuginfo files]' '(-I --histogram)'{-I,--histogram}'[show histogram of bucket list lengths]' '(-W --wide)'{-W,--wide}'[allow output width to exceed 80 characters]' @@ -59,8 +59,11 @@ case $variant in '--no-recurse-limit[disable demangling recursion limit]' '-U+[specify how to display unicode characters]:method:(d l e x h i)' '--unicode=[specify how to display unicode characters]:method:(default locale escape hex highlight invalid)' + '(-X --extra-sym-info)'{-X,--extra-sym-info}'[display extra information when showing symbols]' + '!(-X --extra-sym-info)--no-extra-sym-info' '(-L --lint --enable-checks)'{-L,--lint,--enable-checks}'[display warning messages for possible problems]' \*{-R,--relocated-dump=}"[dump contents of specified section as relocated bytes]:section:($sections)" + \*{-j,--display-section=}'[display contents of specified section]:section' "--dwarf-depth=[don't show DIEs at greater than specified depth]:depth" '--dwarf-start=[show DIEs starting at specified depth or deeper]:depth' '--ctf=[display compact C type format info from section]:section' diff --git a/Completion/Unix/Command/_strip b/Completion/Unix/Command/_strip index cc67ae49a..59cb537b9 100644 --- a/Completion/Unix/Command/_strip +++ b/Completion/Unix/Command/_strip @@ -41,6 +41,7 @@ if _pick_variant -r variant gnu=GNU elftoolchain=elftoolchain $OSTYPE --version; '(-D --enable-deterministic-archives -U --disable-deterministic-archives)'{-U,--disable-deterministic-archives}'[disable -D behavior]' '(-D --enable-deterministic-archives -U --disable-deterministic-archives)'{-D,--enable-deterministic-archives}'[produce deterministic output when stripping archives (zero file metadata)]' '--remove-relocations=[remove relocations from specified section]:section' + '--strip-section-headers[strip section headers from the output]' '--strip-dwo[remove all DWARF .dwo sections]' '!(--no-merge-notes)'{-M,--merge-notes} "--no-merge-notes[don't attempt to remove redundant notes]" diff --git a/Completion/Unix/Command/_uptime b/Completion/Unix/Command/_uptime index 58b4d991b..64d2e15fe 100644 --- a/Completion/Unix/Command/_uptime +++ b/Completion/Unix/Command/_uptime @@ -9,9 +9,10 @@ case $variant in _arguments -s -S : \ '(: -)'{-h,--help}'[display help information]' \ '(: -)'{-V,--version}'[display version information]' \ - + '(excl)' \ - {-p,--pretty}'[display uptime in pretty format]' \ - {-s,--since}'[display date/time of system boot]' + '(-c --container)'{-c,--container}'[show container uptime]' \ + '(-p --pretty -s --since -r --raw)'{-p,--pretty}'[display uptime in pretty format]' \ + '(-r --raw -p --pretty)'{-r,--raw}'[uptime values in raw format]' \ + '(-s --since -p --pretty)'{-s,--since}'[display date/time of system boot]' return ;; gnu) diff --git a/Completion/Unix/Command/_w b/Completion/Unix/Command/_w index 408cb76af..2da57a8f6 100644 --- a/Completion/Unix/Command/_w +++ b/Completion/Unix/Command/_w @@ -6,6 +6,7 @@ case $OSTYPE in linux*) args=( '(H -f --from)'{-f,--from}'[toggle display of remote hostname]' + '(-c --container)'{-c,--container}'[show container uptime]' '(H -h)--no-header[suppress the heading]' '(H -i --ip-addr)'{-i,--ip-addr}'[display IP address instead of hostname]' '(H -o --old-style -s --short)'{-o,--old-style}'[old style output format]' -- cgit v1.2.3