diff options
author | dana <dana@dana.is> | 2018-01-04 11:48:02 -0600 |
---|---|---|
committer | Oliver Kiddle <opk@zsh.org> | 2018-01-05 15:29:17 +0100 |
commit | ae059841b0791195fbae04bafc2acc73058b48fc (patch) | |
tree | ba2e709e60b51bd2f28f98affd40812a5cd63c75 /Completion/Unix/Command/_fold | |
parent | 48f01128be4d943e0c65a284b36e946e93bf2d05 (diff) | |
download | zsh-ae059841b0791195fbae04bafc2acc73058b48fc.tar.gz zsh-ae059841b0791195fbae04bafc2acc73058b48fc.tar.xz zsh-ae059841b0791195fbae04bafc2acc73058b48fc.zip |
42223: new completions for sublime text and some basic Unix utilities
Diffstat (limited to 'Completion/Unix/Command/_fold')
-rw-r--r-- | Completion/Unix/Command/_fold | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/Completion/Unix/Command/_fold b/Completion/Unix/Command/_fold new file mode 100644 index 000000000..1a3ef8b55 --- /dev/null +++ b/Completion/Unix/Command/_fold @@ -0,0 +1,24 @@ +#compdef fold gfold + +local variant +local -a args + +_pick_variant -r variant busybox=BusyBox gnu='Free Soft' unix --version + +args=( + '(-b --bytes)'{-b,--bytes}'[count bytes rather than columns]' + '(: -)--help[display help information]' + '(-s --spaces)'{-s,--spaces}'[fold on whitespace]' + '(-w --width)'{-w+,--width=}'[specify line width]:line width (columns or bytes)' + '(: -)--version[display version information]' + '*: :_files' +) + +# Non-GNU variants don't support long options (except BusyBox's --help) +if [[ $variant == *busybox* ]]; then # See also: _busybox + args=( ${args:#((#s)|*\))(\*|)--^help*} ) +elif [[ $variant != gnu ]]; then + args=( ${args:#((#s)|*\))(\*|)--*} ) +fi + +_arguments -s -S : $args |