summaryrefslogtreecommitdiff
path: root/Completion/Unix/Command/_ptx
diff options
context:
space:
mode:
authorAxel Beckert <abe@deuxchevaux.org>2022-04-11 00:18:04 +0200
committerAxel Beckert <abe@deuxchevaux.org>2022-04-11 00:18:04 +0200
commit31bcc5c263aea983e967426e2b94269e7605dcd4 (patch)
tree7b48ad9d7799afe09b7d7d8adc980bd5db935bdf /Completion/Unix/Command/_ptx
parent5086b5356abcef8849dc8a09902b7c55f01db3c0 (diff)
parentb09f4483416c54c1782824633dfabaf2ec0265b6 (diff)
downloadzsh-31bcc5c263aea983e967426e2b94269e7605dcd4.tar.gz
zsh-31bcc5c263aea983e967426e2b94269e7605dcd4.zip
Update upstream source from tag 'upstream/5.8.1.2-test'
Update to upstream version '5.8.1.2-test' with Debian dir b380d582bf51cd93149e4dea28fffa1ad85db4f5
Diffstat (limited to 'Completion/Unix/Command/_ptx')
-rw-r--r--Completion/Unix/Command/_ptx54
1 files changed, 54 insertions, 0 deletions
diff --git a/Completion/Unix/Command/_ptx b/Completion/Unix/Command/_ptx
new file mode 100644
index 000000000..12f1d2c9a
--- /dev/null
+++ b/Completion/Unix/Command/_ptx
@@ -0,0 +1,54 @@
+#compdef ptx
+
+local -a specs optA
+
+# common specs
+specs=(
+ '(hv -b --break-file)'{-b+,--break-file=}'[use characters in specified file as word separators]:break file:_files'
+ '(hv -f --ignore-case)'{-f,--ignore-case}'[fold lower case to upper case for sorting]'
+ '(hv -g --gap-size)'{-g+,--gap-size=}'[specify gap size between output fields]:number of chars [3]: '
+ '(hv -i --ignore-file)'{-i+,--ignore-file=}'[ignore keywords listed in specified file]:ignore file:_files'
+ '(hv -o --only-file)'{-o+,--only-file=}'[use only the keywords listed in specified file]:only file:_files'
+ '(hv -r --references)'{-r,--references}'[first field of each line is a reference]'
+ '(hv -w --width)'{-w+,--width=}'[specify page width, reference excluded]:number of characters [72]: '
+)
+
+if _pick_variant gnu=GNU unix --version; then
+ # GNU coreutils 8.32
+ specs+=(
+ '(hv -A --auto-reference)'{-A,--auto-reference}'[output automatically generated references]'
+ '(hv -G --traditional)'{-G,--traditional}"[behave more like System V 'ptx']"
+ '(hv -F --flag-truncation)'{-F+,--flag-truncation=}'[specify string for flagging line truncations]:string [/]: '
+ '(hv -M --macro-name)'{-M+,--macro-name=}"[specify macro name to use instead of 'xx']:macro name: "
+ '(hv)-O[generate output as roff directives]'
+ '(hv -R --right-side-refs)'{-R,--right-side-refs}'[put references at right, not counted in -w]'
+ '(hv -S --sentence-regexp)'{-S+,--sentence-regexp=}'[specify regexp for end of lines/sentences]:regexp: '
+ '(hv)-T[generate output as TeX directives]'
+ '(hv -W --word-regexp -b --break-file)'{-W+,--word-regexp=}'[specify regexp to match each keyword]:regexp: '
+ '(hv)--format=[specify the output format]:format:(roff tex)'
+ !{-t,--typeset-mode}'[not implemented]'
+ + hv
+ '(: * -)--help[display help and exit]'
+ '(: * -)--version[output version information and exit]'
+ )
+ if (( $words[(I)(-G|--traditional)] )); then
+ specs+=( + arg '1:input file:_files' '2:output file:_files' )
+ else
+ specs+=( + arg '(-G --traditional)*:input file:_files' )
+ fi
+else
+ # The only non-GNU implementation I can find is the one in
+ # heirloom-doctools. FreeBSD has a package for this.
+ specs=( ${specs:#(|*\))--*} ) # remove long options
+ # remove '+' from -b+ -g+ -i+ -o+ -w+
+ local MATCH MBEGIN MEND
+ specs=( ${specs/(#m)-[bgiow]+/$MATCH[1,-2]} )
+ specs+=(
+ '-t[prepare output for typesetter]'
+ '1:input file:_files'
+ '2:output file:_files'
+ )
+ optA=( -A '-?*' ) # a single '-' is a valid file name (stdin)
+fi
+
+_arguments -s -S $optA : $specs