diff options
author | dana <dana@dana.is> | 2018-06-02 18:07:35 -0500 |
---|---|---|
committer | Oliver Kiddle <okiddle@yahoo.co.uk> | 2018-06-04 00:19:02 +0200 |
commit | 32ac8c5bcb9e9a21d60313d28c494bebca39a89c (patch) | |
tree | f723550cfc615d751f819ac3dc6abbddc8504fba /Completion/Unix/Command/_shuf | |
parent | 3585c28c36f98840de66e7ac8ccfe6f274162097 (diff) | |
download | zsh-32ac8c5bcb9e9a21d60313d28c494bebca39a89c.tar.gz zsh-32ac8c5bcb9e9a21d60313d28c494bebca39a89c.tar.xz zsh-32ac8c5bcb9e9a21d60313d28c494bebca39a89c.zip |
42919: new shuf and uptime completions
Diffstat (limited to 'Completion/Unix/Command/_shuf')
-rw-r--r-- | Completion/Unix/Command/_shuf | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/Completion/Unix/Command/_shuf b/Completion/Unix/Command/_shuf new file mode 100644 index 000000000..83f42e6d3 --- /dev/null +++ b/Completion/Unix/Command/_shuf @@ -0,0 +1,28 @@ +#compdef shuf gshuf + +local ret=1 +local -a context line state state_descr +local -A opt_args + +_arguments -s -S : \ + '(: -)--help[display help information]' \ + '(: -)--version[display version information]' \ + '(-n --head-count)'{-n+,--head-count=}'[limit output to specified number of lines]:output line limit' \ + '(-o --output)'{-o+,--output=}'[write result to specified file]:output file:_files' \ + '--random-source=[use specified file as source of random bytes]: :_files' \ + '(-r --repeat)'{-r,--repeat}'[allow output lines to repeat]' \ + '(-z --zero-terminated)'{-z,--zero-terminated}'[use NUL as line delimiter]' \ + '(-i --input-range)*: :->operands' \ + + '(excl)' \ + {-e,--echo}'[treat operands as input lines]' \ + '(:)'{-i+,--input-range=}'[treat specified numbers as input lines]:number range (x-y)' \ +&& ret=0 + +[[ $state == operands ]] && +if [[ -n ${opt_args[(i)excl-(-e|--echo)]} ]]; then + _message 'input line' && ret=0 +else + _files && ret=0 +fi + +return ret |