From 45d910356ad6b75d47e56ed5cef2f43bffc12fca Mon Sep 17 00:00:00 2001 From: Oliver Kiddle Date: Tue, 14 Mar 2017 16:13:05 +0100 Subject: 40842: update completions for coreutils and similar utilities, also improving BSD and Solaris support --- Completion/Unix/Command/_basename | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 Completion/Unix/Command/_basename (limited to 'Completion/Unix/Command/_basename') diff --git a/Completion/Unix/Command/_basename b/Completion/Unix/Command/_basename new file mode 100644 index 000000000..a826b56b0 --- /dev/null +++ b/Completion/Unix/Command/_basename @@ -0,0 +1,27 @@ +#compdef basename gbasename + +local args variant +_pick_variant -r variant gnu=GNU $OSTYPE --version + +case $variant in + gnu) + args=( -s -S -A "-*" + '(2 -a --multiple)'{-a,--multiple}'[support multiple arguments, handling each]' + '(2 -a --multiple -s --suffix)'{-s+,--suffix=}'[remove a trailing suffix]:suffix' + '(-z --zero)'{-z,--zero}'[separate output with NUL rather than newline]' + '(- *)--version[display version information]' + '(- *)--help[display help information]' + ) + ;; + darwin*|dragonfly*|freebsd*) + args=( -s -S -A "-*" + '(2)-a[support multiple arguments, handling each]' + '(-a 2)-s+[remove a trailing suffix]:suffix' + ) + ;; +esac + +_arguments $args \ + '1:file:_files' \ + '(*)2:suffix' \ + '*:file:_files' -- cgit v1.2.3