From 8498f8864e1a8f6991bd99c8068991a706cde436 Mon Sep 17 00:00:00 2001 From: Daniel Shahaf Date: Thu, 7 May 2020 22:22:36 +0000 Subject: unposted: Use alternation patterns rather than brace expansion (Cf. discussion on GitLab !12.) --- Completion/Unix/Command/_pandoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Completion/Unix/Command/_pandoc') diff --git a/Completion/Unix/Command/_pandoc b/Completion/Unix/Command/_pandoc index 29d3724e0..0c0672aaa 100644 --- a/Completion/Unix/Command/_pandoc +++ b/Completion/Unix/Command/_pandoc @@ -391,7 +391,7 @@ _arguments -C \ '--epub-chapter-level=[specify the header level at which to split the EPUB into separate "chapter" files]:number:_pandoc_header_level' \ '--pdf-engine=[use the specified engine when producing PDF output]:program:_pandoc_pdf_engine' \ '*--pdf-engine-opt=[use the given string as a command-line argument to the pdf-engine]:string:_pandoc_pdf_engine_opts' \ - '*--bibliography=[set the bibliography field in the document'"'"'s metadata to FILE]:file:{_files -g "*.{bib,bibtex,copac,json,yaml,enl,xml,wos,medline,mods,ris}"}' \ + '*--bibliography=[set the bibliography field in the document'"'"'s metadata to FILE]:file:{_files -g "*.(bib|bibtex|copac|json|yaml|enl|xml|wos|medline|mods|ris)"}' \ '--csl=[set the csl field in the document'"'"'s metadata to FILE]:file:{_files -g "*.csl"}' \ '--citation-abbreviations=[set the citation-abbreviations field in the document'"'"'s metadata to FILE]:file:_files' \ '--natbib[use natbib for citations in LaTeX output]' \ -- cgit v1.2.3 From ccc9cff9e244725ed604fd1ac20e4958339e3885 Mon Sep 17 00:00:00 2001 From: Jun-ichi Takimoto Date: Wed, 28 Apr 2021 22:35:51 +0900 Subject: 48702: _pandoc: don't use cache, multiple extensions of format, etc. --- ChangeLog | 5 + Completion/Unix/Command/_pandoc | 375 ++++++++++++---------------------------- 2 files changed, 119 insertions(+), 261 deletions(-) (limited to 'Completion/Unix/Command/_pandoc') diff --git a/ChangeLog b/ChangeLog index 72c48a18b..17a385fcb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2021-04-28 Jun-ichi Takimoto + + * 48702: Completion/Unix/Command/_pandoc: do not use cache, + support two or more extensions of format, and other fixes + 2021-04-21 Daniel Shahaf * 48606 + 48607 + unposted test: Functions/Math/zmathfunc, diff --git a/Completion/Unix/Command/_pandoc b/Completion/Unix/Command/_pandoc index 0c0672aaa..2ff481e32 100644 --- a/Completion/Unix/Command/_pandoc +++ b/Completion/Unix/Command/_pandoc @@ -1,127 +1,37 @@ #compdef pandoc -# {{{ helper: cache policy for available formats and other variables -(( $+functions[__pandoc_cache_policy] )) || -__pandoc_cache_policy(){ - local cache_file="$1" - if [[ -f "${commands[pandoc]}" && -f "${cache_file}" ]]; then - # if the manifest file is newer then the cache: - if [[ "${commands[pandoc]}" -nt "${cache_file}" ]]; then - return 0 - else - return 1 - fi +# {{{ input or output formats with optional extensions +# required option: -T (input|output) +(( $+functions[_pandoc_format] )) || +_pandoc_format() { + local -a inout expl + zparseopts -D -E - T:=inout + local format=${PREFIX%%(+|-)*} + if compset -P '*(+|-)'; then + local pm=${IPREFIX[-1]} # '+' or '-' + local -a extensions=(${${$(pandoc --list-extensions=$format):#$pm*}#(+|-)}) + _wanted extensions expl 'extension' compadd -S '+' -r '-+ ' -a extensions else - return 0 + local -a formats=( $(pandoc --list-$inout[2]-formats) ) + _wanted formats expl 'format' compadd -S '+' -r '-+ ' -a formats fi } # }}} -# {{{ choose a format among supported output format -(( $+functions[_pandoc_output_format] )) || -_pandoc_output_format(){ - local update_policy - zstyle -s ":completion:${curcontext}:" cache-policy update_policy - if [[ -z "$update_policy" ]]; then - zstyle ":completion:${curcontext}:" cache-policy __pandoc_cache_policy - fi - if _cache_invalid pandoc_output_formats_simple; then - output_formats_simple=($(pandoc --list-output-formats)) - _store_cache pandoc_output_formats_simple output_formats_simple - else - _retrieve_cache pandoc_output_formats_simple - fi - if _cache_invalid pandoc_output_formats_plus_extensible || _cache_invalid pandoc_output_formats_minus_extensible; then - for f in ${output_formats_simple[*]}; do - for e in $(pandoc --list-extensions=${f}); do - if [[ "${e}" =~ '^\+' ]]; then - output_formats_plus_extensible+=("${f}${e}") - elif [[ "${e}" =~ '^\-' ]]; then - output_formats_minus_extensible+=("${f}${e}") - fi - done - done - _store_cache pandoc_output_formats_minus_extensible output_formats_minus_extensible - _store_cache pandoc_output_formats_plus_extensible output_formats_plus_extensible - else - _retrieve_cache pandoc_output_formats_minus_extensible - _retrieve_cache pandoc_output_formats_plus_extensible - fi - _alternative \ - 'formats_plus:format:{_multi_parts "+" output_formats_plus_extensible}' \ - 'formats_minus:format:{_multi_parts -- "-" output_formats_minus_extensible}' -} -# }}} -# {{{ choose a format among supported input format -(( $+functions[_pandoc_input_format] )) || -_pandoc_input_format(){ - local update_policy - zstyle -s ":completion:${curcontext}:" cache-policy update_policy - if [[ -z "$update_policy" ]]; then - zstyle ":completion:${curcontext}:" cache-policy __pandoc_cache_policy - fi - if _cache_invalid pandoc_input_formats_simple; then - input_formats_simple=($(pandoc --list-input-formats)) - _store_cache pandoc_input_formats_simple input_formats_simple - else - _retrieve_cache pandoc_input_formats_simple - fi - if _cache_invalid pandoc_input_formats_plus_extensible || _cache_invalid pandoc_input_formats_minus_extensible; then - for f in ${input_formats_simple[*]}; do - for e in $(pandoc --list-extensions=${f}); do - if [[ "${e}" =~ '^\+' ]]; then - input_formats_plus_extensible+=("${f}${e}") - elif [[ "${e}" =~ '^\-' ]]; then - input_formats_minus_extensible+=("${f}${e}") - fi - done - done - _store_cache pandoc_input_formats_minus_extensible input_formats_minus_extensible - _store_cache pandoc_input_formats_plus_extensible input_formats_plus_extensible - else - _retrieve_cache pandoc_input_formats_minus_extensible - _retrieve_cache pandoc_input_formats_plus_extensible - fi - _alternative \ - 'formats_plus:format:{_multi_parts "+" input_formats_plus_extensible}' \ - 'formats_minus:format:{_multi_parts -- "-" input_formats_minus_extensible}' -} -# }}} -# {{{ choose a format among all supported formats +# {{{ all supported formats (( $+functions[_pandoc_all_formats] )) || _pandoc_all_formats(){ - local update_policy - zstyle -s ":completion:${curcontext}:" cache-policy update_policy - if [[ -z "$update_policy" ]]; then - zstyle ":completion:${curcontext}:" cache-policy __pandoc_cache_policy - fi - if _cache_invalid pandoc_input_formats_simple; then - input_formats_simple=($(pandoc --list-input-formats)) - _store_cache pandoc_input_formats_simple input_formats_simple - else - _retrieve_cache pandoc_input_formats_simple - fi - if _cache_invalid pandoc_output_formats_simple; then - output_formats_simple=($(pandoc --list-output-formats)) - _store_cache pandoc_output_formats_simple output_formats_simple - else - _retrieve_cache pandoc_output_formats_simple - fi - if _cache_invalid pandoc_all_formats; then - all_formats=(${output_formats_simple} ${input_formats_simple}) - all_formats=($(sort -u <<<"${all_formats[*]}")) - _store_cache pandoc_all_formats all_formats - else - _retrieve_cache pandoc_all_formats - fi - _describe "format" all_formats + local -a expl + local -aU formats + formats=( $(pandoc --list-input-formats) $(pandoc --list-output-formats) ) + _wanted formats expl 'format' compadd -a formats } # }}} # {{{ pdf engine choice (( $+functions[_pandoc_pdf_engine] )) || _pandoc_pdf_engine(){ _alternative \ - 'engines:engine:{_values "engine" pdflatex lualatex xelatex wkhtmltopdf weasyprint prince context pdfroff}' \ - 'engine_files:engine:_files' + 'engines:engine:(pdflatex lualatex xelatex latexmk tectonic wkhtmltopdf weasyprint prince context pdfroff)' \ + 'engine-executables:engine executable:_files -g "*(#q*)"' } # }}} # {{{ options to pass to --pdf-engine command @@ -133,121 +43,72 @@ _pandoc_pdf_engine_opts(){ _tex ;; *) - type _${pdf_engine} > /dev/null - if [[ $? == 1 ]]; then - _message "Options for ${pdf_engine}" - fi + _message "Options for ${pdf_engine}" ;; esac } # }}} -# {{{ choose data-dir -(( $+functions[_pandoc_data_dir] )) || -_pandoc_data_dir(){ - _files -/ +# {{{ data-dir specified by --data-dir option, or the default dir +_pandoc_default_dir() { + if (( $+opt_args[--data-dir] )); then + echo ${opt_args[--data-dir]:a} + else + # XXX Some versions of pandoc may output two user data directories: + # ~/.local/share/pandoc or ~/.pandoc + # Here we use only the first one. + pandoc --version | sed -ne 's/.*[Uu]ser data directory: \([^ ]*\).*/\1/p' + fi } -# }}} -# {{{ choose template from data-dir +# {{{ template file in $PWD or data-dir/templates/, or URL (( $+functions[_pandoc_template] )) || _pandoc_template(){ - local update_policy - zstyle -s ":completion:${curcontext}:" cache-policy update_policy - if [[ -z "$update_policy" ]]; then - zstyle ":completion:${curcontext}:" cache-policy __pandoc_cache_policy - fi - if _cache_invalid pandoc_output_formats_simple; then - output_formats_simple=($(pandoc --list-output-formats)) - _store_cache pandoc_output_formats_simple output_formats_simple - else - _retrieve_cache pandoc_output_formats_simple - fi - local data_dir=${opt_args[--data-dir]} - if [[ -z $data_dir ]]; then - if _cache_invalid pandoc_default_data_dir; then - default_data_dir=$(pandoc --version | sed -ne 's/Default user data directory: \(.*\)/\1/p') - _store_cache pandoc_default_data_dir default_data_dir - else - _retrieve_cache pandoc_default_data_dir - fi - data_dir=${default_data_dir} - fi - _pandoc_template_find_args="-name '*.'${output_formats_simple[1]}" - for ((i = 2; i < ${#output_formats_simple[@]}; i++ )); do - _pandoc_template_find_args=$_pandoc_template_find_args" -or -name '*.'${output_formats_simple[$i]}" - done - templates=($(eval find -L ${data_dir}/templates ${_pandoc_template_find_args} 2>/dev/null | sed -e 's/.*\///' -e 's/\.[^.]*$//')) - if [[ -z "${templates}" ]]; then - templates=default - fi - _describe 'templates from default data-dir' templates + # find output format from '-t format' or '-o xxx.format' + local format=${${(v)opt_args[(i)(-t|--to|-w|--write)]}%%(+|-)*} + [[ -z $format ]] && format=${(v)opt_args[(i)(-o|--output)]:e} + local pat="'*'" # or '*.*' ? + [[ -n $format ]] && pat="'*.$format'" + local template_dir=$(_pandoc_default_dir)/templates + _alternative \ + "local-templates:local template:_files -g $pat" \ + "data-dir-templates:template in data-dir:_files -W $template_dir -g $pat" \ + 'urls: :_urls' } # }}} # {{{ choose highlight-style (( $+functions[_pandoc_highlight_style] )) || _pandoc_highlight_style(){ - local update_policy - zstyle -s ":completion:${curcontext}:" cache-policy update_policy - if [[ -z "$update_policy" ]]; then - zstyle ":completion:${curcontext}:" cache-policy __pandoc_cache_policy - fi - if _cache_invalid pandoc_highlighting_styles; then - highlighting_styles=($(pandoc --list-highlight-styles)) - _store_cache pandoc_highlighting_styles highlighting_styles - else - _retrieve_cache pandoc_highlighting_styles - fi _alternative \ - 'styles:style:{_values "syntax builting style" ${highlighting_styles[*]}}' \ - 'style_files_here:style:{_files -g "*.theme"}' + 'styles:style:( $(pandoc --list-highlight-styles) )' \ + 'style-files:style file:_files -g "*.theme"' } # }}} -# {{{ choose filter from specified or default data-dir +# {{{ filter file in $PWD, data-dir/filters/ or $PATH (( $+functions[_pandoc_filter] )) || _pandoc_filter(){ - local update_policy - zstyle -s ":completion:${curcontext}:" cache-policy update_policy - if [[ -z "$update_policy" ]]; then - zstyle ":completion:${curcontext}:" cache-policy __pandoc_cache_policy - fi - local data_dir=${opt_args[--data-dir]} - if [[ -z $data_dir ]]; then - if _cache_invalid pandoc_default_data_dir; then - default_data_dir=$(pandoc --version | sed -ne 's/Default user data directory: \(.*\)/\1/p') - _store_cache pandoc_default_data_dir default_data_dir - else - _retrieve_cache pandoc_default_data_dir - fi - data_dir=${default_data_dir} - fi - local filters_dir=$data_dir"/filters" + local filters_dir=$(_pandoc_default_dir)/filters _alternative \ - 'local_filter:filter:{_files -g "*.lua"}' \ - 'data_dir_filter:filter:{_files -W filters_dir -g "*.lua"}' + 'local-filters:local filter:_files' \ + 'data-dir-filters:filter in data-dir:_files -W filters_dir' \ + 'commands: : _command_names -e' } # }}} -# {{{ choose lua filter from specified or default data-dir +# {{{ lua filter in $PWD or data-dir/filters/ (( $+functions[_pandoc_lua_filter] )) || _pandoc_lua_filter(){ - local update_policy - zstyle -s ":completion:${curcontext}:" cache-policy update_policy - if [[ -z "$update_policy" ]]; then - zstyle ":completion:${curcontext}:" cache-policy __pandoc_cache_policy - fi - local data_dir=${opt_args[--data-dir]} - if [[ -z $data_dir ]]; then - if _cache_invalid pandoc_default_data_dir; then - default_data_dir=$(pandoc --version | sed -ne 's/Default user data directory: \(.*\)/\1/p') - _store_cache pandoc_default_data_dir default_data_dir - else - _retrieve_cache pandoc_default_data_dir - fi - data_dir=${default_data_dir} - fi - local filters_dir=$data_dir"/filters" + local filters_dir=$(_pandoc_default_dir)/filters _alternative \ - 'local_filter:filter:{_files -g "(#q*)(.)"}' \ - 'data_dir_filter:filter:{_files -W filters_dir -g "(#q*)(.)"}' - } + 'local-filters:local filter:_files -g "*.lua"' \ + 'data-dir-filters:filter in data-dir:_files -W filters_dir -g "*.lua"' +} +# }}} +# {{{ default file in $PWD or data-dir/defaults/ +(( $+functions[_pandoc_defaults_file] )) || +_pandoc_defaults_file() { + local defaults_dir=$(_pandoc_default_dir)/defaults + _alternative \ + 'local-defaults:default file:_files -g "*.yaml"' \ + 'data-dir-defaults:default in data-dir:_files -W defaults_dir -g "*.yaml"' +} # }}} # {{{ choose reference location (( $+functions[_pandoc_reference_location] )) || @@ -261,23 +122,12 @@ _pandoc_reference_location(){ _describe 'location' policies } # }}} -# --base-header-level must be 1-5: https://github.com/jgm/pandoc/blob/34d8ffbcfc33b86766ff7229be4d8a0d1fbffb50/src/Text/Pandoc/App.hs#L867 # {{{ choose top level division (( $+functions[_pandoc_top_level_division] )) || _pandoc_top_level_division(){ _values 'top level division' default section chapter part } # }}} -# {{{ choose header levels -(( $+functions[_pandoc_header_levels] )) || -_pandoc_header_levels(){ - _values -s , "number" 1 2 3 4 5 6 -} -(( $+functions[_pandoc_header_level] )) || -_pandoc_header_level(){ - _values "number" 1 2 3 4 5 6 -} -# }}} # {{{ choose email obfusication (( $+functions[_pandoc_email_obfusication] )) || _pandoc_email_obfusication(){ @@ -328,67 +178,74 @@ _pandoc_track_changes() { # }}} # The real thing -_arguments -C \ - {-f,-r,--from=,--read=}'[specify input format]:format:_pandoc_input_format' \ - {-t,-w,--to=,--write=}'[specify output format]:format:_pandoc_output_format' \ - {-o,--output=}'[write output to FILE instead of stdout]:file:_files' \ - '--data-dir=[specify the user data directory to search for pandoc data files]:dir:_pandoc_data_dir' \ - '--base-header-level=[specify the base level for headers (defaults to 1)]:number:_pandoc_header_level' \ - '--strip-empty-paragraphs[deprecated. Use the +empty_paragraphs extension instead]: :' \ +_arguments -s \ + {-f+,-r+,--from=,--read=}'[specify input format]: :_pandoc_format -T input' \ + {-t+,-w+,--to=,--write=}'[specify output format]: :_pandoc_format -T output' \ + {-o+,--output=}'[write output to FILE instead of stdout]:file:_files' \ + '--data-dir=[specify the user data directory to search for pandoc data files]:data directory:_files -/' \ + {-d+,--defauls=}'[read default from YAMAL file]: :_pandoc_defaults_file' \ + '--shift-heading-level-by=[shift heading levels by specified number]:positive or negative integer: ' \ + '!--base-header-level=[(deprecated) specify the base level for headers]:number (default 1):(1 2 3 4 5)' \ + '!--strip-empty-paragraphs[deprecated. Use the +empty_paragraphs extension instead]' \ '--indented-code-classes=[classes to use for indented code blocks]:class:{_message "Classes separated with ,"}' \ - '*--filter=[specify an executable to be used as a filter transforming the pandoc AST after the input is parsed and before the output is written]:file:_pandoc_filter' \ - '*--lua-filter=[transform the document in a similar fashion as JSON filters (see --filter), but use pandoc'"'"'s built-in lua filtering system]:file:_pandoc_lua_filter' \ - {-p,--preserve-tabs}'[preserve tabs instead of converting them to spaces]: :' \ + '--default-image-extension=[specify a default extension to use when image paths/URLs have no extension]:extension: ' \ + '--file-scope[parse each file individually before combining for multifile documents]' \ + {\*-F+,\*--filter=}'[specify an executable to be used as a filter transforming the pandoc AST after the input is parsed and before the output is written]: :_pandoc_filter' \ + {\*-L+,\*--lua-filter=}"[transform the document by using pandoc's built-in lua filtering system]: :_pandoc_lua_filter" \ + {\*-M+,\*--metadata=}'[set the metadata field KEY to the value VALUE]:key\:value: ' \ + '*--metadata_file=[read metadata from file]:YAML or JSON file:_files' \ + {-p,--preserve-tabs}'[preserve tabs instead of converting them to spaces]' \ '--tab-stop=[specify the number of spaces per tab (default is 4)]:number:{_message -r "choose a number equals to or greater then 1"}' \ '--track-changes=[specifies what to do with insertions, deletions, and comments produced by the MS Word "Track Changes" feature]: :_pandoc_track_changes' \ - '--file-scope[parse each file individually before combining for multifile documents]: :' \ - '--extract-media=[extract images and other media contained in or linked from the source document to the path DIR]:dir:{_dir_list}' \ - {-s,--standalone}'[produce output with an appropriate header and footer]: :' \ + '--extract-media=[extract media in source document to specified directory]:directory:_files -/' \ + '--abbreviations=[specifies a custom abbreviations file]:file:_files ' \ + {-s,--standalone}'[produce output with an appropriate header and footer]' \ '--template=[use FILE as a custom template for the generated document. Implies --standalone]: :_pandoc_template' \ - {\*-M,\*--metadata=}'[set the metadata field KEY to the value VALUE]:key\:value: ' \ - {\*-V,\*--variable=}'[set the variable KEY to the value VALUE]:key\:value: ' \ - '(- :)'{-D,--print-default-template=}'[print the system default template for an output]:format:_pandoc_output_format' \ + {\*-V+,\*--variable=}'[set the variable KEY to the value VALUE]:key\:value: ' \ + '(- :)'{-D+,--print-default-template=}'[print the system default template for an output]:format:( $(pandoc --list-output-formats) )' \ '(- :)--print-default-data-file=[print a system default data file]:file: ' \ - '(- :)--print-highlight-style=[prints a JSON version of a highlighting style]:style|file: ' \ - '--dpi=[specify the dpi (dots per inch) value for conversion from pixels to inch/centimeters and vice versa]:number: ' \ '--eol=[manually specify line endings (crlf|lf|native)]: :_pandoc_eol' \ + '--dpi=[specify the dpi (dots per inch) value for conversion from pixels to inch/centimeters and vice versa]:number: ' \ '--wrap=[determine how text is wrapped in the output (the source code, not the rendered version)]: :_pandoc_wrap ' \ '--columns=[specify length of lines in characters (default 72)]:number: ' \ - '--strip-comments[strip out HTML comments in the Markdown or Textile source]: : ' \ - {--toc,--table-of-contents}'[include an automatically generated table of contents]: : ' \ + {--toc,--table-of-contents}'[include an automatically generated table of contents]' \ '--toc-depth=[specify the number of section levels to include in the table of contents]:number:{_message -r "choose a number equals to or greater then 1"}' \ - '--no-highlight[disables syntax highlighting for code blocks and inlines]: : ' \ + '--strip-comments[strip out HTML comments in the Markdown or Textile source]' \ + '--no-highlight[disables syntax highlighting for code blocks and inlines]' \ '--highlight-style=[specifies the coloring style to be used in highlighted source code]:style|file:_pandoc_highlight_style' \ + '(- :)--print-highlight-style=[prints a JSON version of a highlighting style]: :_pandoc_highlight_style' \ '--syntax-definition=[load a KDE XML syntax definition file]:file:{_files -g "*.xml"}' \ - {\*-H,\*--include-in-header=}'[include contents of FILE, verbatim, at the end of the header, implies --standalone]:file:_files' \ - {\*-B,\*--include-before-body=}'[include contents of FILE, verbatim, at the beginning of the document body, implies --standalone]:file:_files' \ - {\*-A,\*--include-end-body=}'[include contents of FILE, verbatim, at the end of the document body, implies --standalone]:file:_files' \ + {\*-H+,\*--include-in-header=}'[include contents of FILE, verbatim, at the end of the header, implies --standalone]:file:_files' \ + {\*-B+,\*--include-before-body=}'[include contents of FILE, verbatim, at the beginning of the document body, implies --standalone]:file:_files' \ + {\*-A+,\*--include-end-body=}'[include contents of FILE, verbatim, at the end of the document body, implies --standalone]:file:_files' \ '--resource-path=[list of paths to search for images and other resources]:searchpath:_dir_list' \ '--request-header=[set the request header NAME to the value VAL when making HTTP requests]:name\:val: ' \ - '--self-contained[produce a standalone HTML file with no external dependencies, using data: URIs to incorporate the contents of linked scripts, stylesheets, images, and videos. Implies --standalone]: : ' \ - '--html-q-tags[use tags for quotes in HTML]: : ' \ - '--ascii[use only ASCII characters in output, supported only for HTML and DocBook output]: : ' \ - '--reference-links[use reference-style links, rather than inline links]: : ' \ + '--no-check-certificate[disable the certificate verification]' \ + '--self-contained[produce a standalone HTML file with no external dependencies, using data: URIs to incorporate the contents of linked scripts, stylesheets, images, and videos. Implies --standalone]' \ + '--html-q-tags[use tags for quotes in HTML]' \ + '--ascii[use only ASCII characters in output, supported only for HTML and DocBook output]' \ + '--reference-links[use reference-style links, rather than inline links]' \ '--reference-location=[specify where footnotes (and references, if reference-links is set) are placed (block|section|document)]: :_pandoc_reference_location' \ - '--atx-headers[use ATX-style headers in Markdown and AsciiDoc output]: : ' \ + '--markdown-headings[specify style for level1 and 2 headings in markdown output]:style (default atx):(setext atx)' \ + '!--atx-headers[use ATX-style headers in Markdown and AsciiDoc output]' \ '--top-level-division=[treat top-level headers as the given division type in LaTeX, ConTeXt, DocBook, and TEI output]: :_pandoc_top_level_division' \ - {-N,--number-sections}'[number section headings in LaTeX, ConTeXt, HTML, or EPUB output]: : ' \ - '--number-offset=[offset for section headings in HTML output (ignored in other output formats)]: :_pandoc_header_levels' \ - '--listings[use the listings package for LaTeX code blocks]: : ' \ - {-i,--incremental}'[make list items in slide shows display incrementally (one by one)]: : ' \ - '--slide-level=[specifies that headers with the specified level create slides (for beamer, s5, slidy, slideous, dzslides)]: :_pandoc_header_levels' \ - '--section-divs[wrap sections in
tags (or
tags for html4)Use the section-divs package for LaTeX code blocks]: : ' \ + {-N,--number-sections}'[number section headings in LaTeX, ConTeXt, HTML, or EPUB output]' \ + '--number-offset=[offset for section headings in HTML output (ignored in other output formats)]:number[number,...] (default 0): ' \ + '--listings[use the listings package for LaTeX code blocks]' \ + {-i,--incremental}'[make list items in slide shows display incrementally (one by one)]' \ + '--slide-level=[specifies that headers with the specified level create slides (for beamer, s5, slidy, slideous, dzslides)]:slide level:(1 2 3 4 5 6)' \ + '--section-divs[wrap sections in
tags (or
tags for html4)Use the section-divs package for LaTeX code blocks]' \ '--email-obfusication=[treat top-level headers as the given division type in LaTeX, ConTeXt, DocBook, and TEI output (none|javascript|references)]: :_pandoc_email_obfusication' \ - '--default-image-extension=[specify a default extension to use when image paths/URLs have no extension]:extension: ' \ '--id-prefix=[specify a prefix to be added to all identifiers and internal links in HTML and DocBook output]:string: ' \ - {-T,--title-prefix=}'[specify STRING as a prefix at the beginning of the title that appears in the HTML header]:string: ' \ - {\*-c,\*--css=}'[link to a CSS style sheet]:url: ' \ + {-T+,--title-prefix=}'[specify STRING as a prefix at the beginning of the title that appears in the HTML header]:string: ' \ + {\*-c+,\*--css=}'[link to a CSS style sheet]: :_urls' \ '--reference-doc=[use the specified file as a style reference in producing a docx or ODT file]:file: ' \ - '--epub-subdirectory=[specify the subdirectory in the OCF container that is to hold the EPUB-specific contents]:dir:{_files -/}' \ + '--epub-subdirectory=[specify the subdirectory in the OCF container that is to hold the EPUB-specific contents]:directory:_files -/' \ '--epub-cover-image=[use the specified image as the EPUB cover]:file:_files' \ '--epub-metadata=[look in the specified XML file for metadata for the EPUB]:file:{_files -g "*.xml"}' \ '*--epub-embed-font=[embed the specified font in the EPUB]:file:_files ' \ - '--epub-chapter-level=[specify the header level at which to split the EPUB into separate "chapter" files]:number:_pandoc_header_level' \ + '--epub-chapter-level=[specify the header level at which to split the EPUB into separate "chapter" files]:number:(1 2 3 4 5 6)' \ + '--ipynb-output=[specify how to tread ipynb output cells]:method:(all none best)' \ '--pdf-engine=[use the specified engine when producing PDF output]:program:_pandoc_pdf_engine' \ '*--pdf-engine-opt=[use the given string as a command-line argument to the pdf-engine]:string:_pandoc_pdf_engine_opts' \ '*--bibliography=[set the bibliography field in the document'"'"'s metadata to FILE]:file:{_files -g "*.(bib|bibtex|copac|json|yaml|enl|xml|wos|medline|mods|ris)"}' \ @@ -397,14 +254,10 @@ _arguments -C \ '--natbib[use natbib for citations in LaTeX output]' \ '--biblatex[use biblatex for citations in LaTeX output]' \ '--mathml[convert TeX math to MathML (in epub3, docbook4, docbook5, jats, html4 and html5)]' \ - '--webtex=[convert TeX formulas to tags that link to an external script that converts formulas to images]::url: ' \ - '--mathjax=[use MathJax to display embedded TeX math in HTML output]::url: ' \ - '--katex=[use KaTeX to display embedded TeX math in HTML output]::url: ' \ - {-m,--latexmathml=,--asciimathml=}'[deprecated. Use the LaTeXMathML script to display embedded TeX math in HTML output]::url: ' \ - '--mimetex=[deprecated. Render TeX math using the mimeTeX CGI script, which generates an image for each TeX formula]::url: ' \ - '--jsmath=[deprecated. Use jsMath (the predecessor of MathJax) to display embedded TeX math in HTML output]::url: ' \ - '--gladtex[deprecated. Enclose TeX math in tags in HTML output]: : ' \ - '--abbreviations=[specifies a custom abbreviations file]:file:_files ' \ + '--webtex=[convert TeX formulas to tags that link to an external script that converts formulas to images]:: :_urls' \ + '--mathjax=[use MathJax to display embedded TeX math in HTML output]:: :_urls' \ + '--katex=[use KaTeX to display embedded TeX math in HTML output]:: :_urls' \ + '--gladtex[Enclose TeX math in tags in HTML output]' \ '--trace[enable tracing]' \ '--dump-args[print information about command-line arguments to stdout, then exit]' \ '--ignore-args[ignore command-line arguments (for use in wrapper scripts)]' \ -- cgit v1.2.3 From a21c0b334c38e6d2a29bc7e0d7697b23d720b64c Mon Sep 17 00:00:00 2001 From: Oliver Kiddle Date: Thu, 3 Jun 2021 00:09:06 +0200 Subject: 48938: remove vim fold and option markers in completions --- ChangeLog | 3 ++ Completion/Unix/Command/_bpython | 3 -- Completion/Unix/Command/_pandoc | 62 ++++++++++++++++++++-------------------- 3 files changed, 34 insertions(+), 34 deletions(-) (limited to 'Completion/Unix/Command/_pandoc') diff --git a/ChangeLog b/ChangeLog index e49333723..772ac111a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2021-06-02 Oliver Kiddle + * 48938 (minus _cdrdao changes): Completion/Unix/Command/_pandoc, + Completion/Unix/Command/_bpython: remove vim fold and option markers + * 48939: Completion/Unix/Command/_rsync: update for rsync 3.2.3 2021-05-21 Oliver Kiddle diff --git a/Completion/Unix/Command/_bpython b/Completion/Unix/Command/_bpython index 233e032e6..2c2ea11b8 100644 --- a/Completion/Unix/Command/_bpython +++ b/Completion/Unix/Command/_bpython @@ -41,6 +41,3 @@ case "$service" in "$gtk_opts[@]" ;; esac - - -# vim:autoindent expandtab shiftwidth=2 tabstop=2 softtabstop=2 filetype=zsh diff --git a/Completion/Unix/Command/_pandoc b/Completion/Unix/Command/_pandoc index 2ff481e32..bdd261322 100644 --- a/Completion/Unix/Command/_pandoc +++ b/Completion/Unix/Command/_pandoc @@ -1,6 +1,6 @@ #compdef pandoc -# {{{ input or output formats with optional extensions +# input or output formats with optional extensions # required option: -T (input|output) (( $+functions[_pandoc_format] )) || _pandoc_format() { @@ -16,8 +16,8 @@ _pandoc_format() { _wanted formats expl 'format' compadd -S '+' -r '-+ ' -a formats fi } -# }}} -# {{{ all supported formats + +# all supported formats (( $+functions[_pandoc_all_formats] )) || _pandoc_all_formats(){ local -a expl @@ -25,16 +25,16 @@ _pandoc_all_formats(){ formats=( $(pandoc --list-input-formats) $(pandoc --list-output-formats) ) _wanted formats expl 'format' compadd -a formats } -# }}} -# {{{ pdf engine choice + +# pdf engine choice (( $+functions[_pandoc_pdf_engine] )) || _pandoc_pdf_engine(){ _alternative \ 'engines:engine:(pdflatex lualatex xelatex latexmk tectonic wkhtmltopdf weasyprint prince context pdfroff)' \ 'engine-executables:engine executable:_files -g "*(#q*)"' } -# }}} -# {{{ options to pass to --pdf-engine command + +# options to pass to --pdf-engine command (( $+functions[_pandoc_pdf_engine_opts] )) || _pandoc_pdf_engine_opts(){ local pdf_engine=${opt_args[--pdf-engine]} @@ -47,8 +47,8 @@ _pandoc_pdf_engine_opts(){ ;; esac } -# }}} -# {{{ data-dir specified by --data-dir option, or the default dir + +# data-dir specified by --data-dir option, or the default dir _pandoc_default_dir() { if (( $+opt_args[--data-dir] )); then echo ${opt_args[--data-dir]:a} @@ -59,7 +59,8 @@ _pandoc_default_dir() { pandoc --version | sed -ne 's/.*[Uu]ser data directory: \([^ ]*\).*/\1/p' fi } -# {{{ template file in $PWD or data-dir/templates/, or URL + +# template file in $PWD or data-dir/templates/, or URL (( $+functions[_pandoc_template] )) || _pandoc_template(){ # find output format from '-t format' or '-o xxx.format' @@ -73,16 +74,16 @@ _pandoc_template(){ "data-dir-templates:template in data-dir:_files -W $template_dir -g $pat" \ 'urls: :_urls' } -# }}} -# {{{ choose highlight-style + +# choose highlight-style (( $+functions[_pandoc_highlight_style] )) || _pandoc_highlight_style(){ _alternative \ 'styles:style:( $(pandoc --list-highlight-styles) )' \ 'style-files:style file:_files -g "*.theme"' } -# }}} -# {{{ filter file in $PWD, data-dir/filters/ or $PATH + +# filter file in $PWD, data-dir/filters/ or $PATH (( $+functions[_pandoc_filter] )) || _pandoc_filter(){ local filters_dir=$(_pandoc_default_dir)/filters @@ -91,8 +92,8 @@ _pandoc_filter(){ 'data-dir-filters:filter in data-dir:_files -W filters_dir' \ 'commands: : _command_names -e' } -# }}} -# {{{ lua filter in $PWD or data-dir/filters/ + +# lua filter in $PWD or data-dir/filters/ (( $+functions[_pandoc_lua_filter] )) || _pandoc_lua_filter(){ local filters_dir=$(_pandoc_default_dir)/filters @@ -100,8 +101,8 @@ _pandoc_lua_filter(){ 'local-filters:local filter:_files -g "*.lua"' \ 'data-dir-filters:filter in data-dir:_files -W filters_dir -g "*.lua"' } -# }}} -# {{{ default file in $PWD or data-dir/defaults/ + +# default file in $PWD or data-dir/defaults/ (( $+functions[_pandoc_defaults_file] )) || _pandoc_defaults_file() { local defaults_dir=$(_pandoc_default_dir)/defaults @@ -109,8 +110,8 @@ _pandoc_defaults_file() { 'local-defaults:default file:_files -g "*.yaml"' \ 'data-dir-defaults:default in data-dir:_files -W defaults_dir -g "*.yaml"' } -# }}} -# {{{ choose reference location + +# choose reference location (( $+functions[_pandoc_reference_location] )) || _pandoc_reference_location(){ local -a policies @@ -121,14 +122,14 @@ _pandoc_reference_location(){ ) _describe 'location' policies } -# }}} -# {{{ choose top level division + +# choose top level division (( $+functions[_pandoc_top_level_division] )) || _pandoc_top_level_division(){ _values 'top level division' default section chapter part } -# }}} -# {{{ choose email obfusication + +# choose email obfusication (( $+functions[_pandoc_email_obfusication] )) || _pandoc_email_obfusication(){ local -a policies @@ -139,8 +140,8 @@ _pandoc_email_obfusication(){ ) _describe 'obfusication' policies } -# }}} -# {{{ choose wrapping policy + +# choose wrapping policy (( $+functions[_pandoc_wrap] )) || _pandoc_wrap() { local -a policies @@ -151,8 +152,8 @@ _pandoc_wrap() { ) _describe 'policy' policies } -# }}} -# {{{ choose eol policy + +# choose eol policy (( $+functions[_pandoc_eol] )) || _pandoc_eol() { local -a policies @@ -163,8 +164,8 @@ _pandoc_eol() { ) _describe 'policy' policies } -# }}} -# {{{ choose changes tracking policy + +# choose changes tracking policy (( $+functions[_pandoc_track_changes] )) || _pandoc_track_changes() { local -a policies @@ -175,7 +176,6 @@ _pandoc_track_changes() { ) _describe 'policy' policies } -# }}} # The real thing _arguments -s \ -- cgit v1.2.3 From 35f9585cd1342a1d962a47be858c7aea60c8f886 Mon Sep 17 00:00:00 2001 From: Oliver Kiddle Date: Sat, 10 Jul 2021 23:35:33 +0200 Subject: 49156: make wider use of the convention of square brackets for defaults --- ChangeLog | 17 +++++++++++++++++ Completion/Cygwin/Command/_cygserver | 8 ++++---- Completion/Debian/Command/_git-buildpackage | 6 +++--- Completion/Linux/Command/_alsa-utils | 2 +- Completion/Linux/Command/_ipset | 19 ++++++------------- Completion/Solaris/Command/_dtrace | 2 +- Completion/Solaris/Command/_prstat | 6 +++--- Completion/Unix/Command/_adb | 4 ++-- Completion/Unix/Command/_ant | 2 +- Completion/Unix/Command/_django | 4 ++-- Completion/Unix/Command/_dtruss | 2 +- Completion/Unix/Command/_gcc | 9 ++++----- Completion/Unix/Command/_gnupod | 4 ++-- Completion/Unix/Command/_initctl | 2 +- Completion/Unix/Command/_mysqldiff | 2 +- Completion/Unix/Command/_pandoc | 22 +++++++++++----------- Completion/Unix/Command/_pbm | 2 +- Completion/Unix/Command/_perforce | 2 +- Completion/Unix/Command/_qemu | 4 ++-- Completion/Unix/Command/_ruby | 2 +- Completion/Unix/Command/_tidy | 2 +- Completion/Unix/Command/_w3m | 2 +- Completion/X/Command/_vnc | 4 ++-- Completion/X/Command/_xdvi | 2 +- 24 files changed, 70 insertions(+), 61 deletions(-) (limited to 'Completion/Unix/Command/_pandoc') diff --git a/ChangeLog b/ChangeLog index 27cc5ce98..1421c357d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,20 @@ +2021-07-10 Oliver Kiddle + + * 49156: Completion/Cygwin/Command/_cygserver, + Completion/Debian/Command/_git-buildpackage, + Completion/Linux/Command/_alsa-utils, Completion/Unix/Command/_adb, + Completion/Linux/Command/_ipset, Completion/Unix/Command/_django, + Completion/Solaris/Command/_dtrace, Completion/Unix/Command/_ant, + Completion/Solaris/Command/_prstat, Completion/Unix/Command/_gcc, + Completion/Unix/Command/_dtruss, Completion/Unix/Command/_gnupod, + Completion/Unix/Command/_initctl, Completion/Unix/Command/_pandoc, + Completion/Unix/Command/_mysqldiff, Completion/Unix/Command/_pbm, + Completion/Unix/Command/_perforce, Completion/Unix/Command/_qemu, + Completion/Unix/Command/_ruby, Completion/Unix/Command/_tidy, + Completion/Unix/Command/_w3m, Completion/X/Command/_vnc, + Completion/X/Command/_xdvi: make wider use of the convention of + square brackets for defaults + 2021-07-08 Oliver Kiddle * 49151: Completion/Debian/Command/_madison, diff --git a/Completion/Cygwin/Command/_cygserver b/Completion/Cygwin/Command/_cygserver index 1c2744c8f..392bf5cbd 100644 --- a/Completion/Cygwin/Command/_cygserver +++ b/Completion/Cygwin/Command/_cygserver @@ -3,14 +3,14 @@ # cygwin 1.5.25 _arguments -s -S \ - '(--config-file -f)'{-f,--config-file}'[use specified file as config file (default /etc/cygserver.conf)]:config file:_files -g "*.conf(-.)"' \ - '(--cleanup-threads -c)'{-c,--cleanup-threads}'[number of cleanup threads to use (default 2)]:number of threads:' \ + '(--config-file -f)'{-f,--config-file}'[use specified config file]:config file [/etc/cygserver.conf]:_files -g "*.conf(-.)"' \ + '(--cleanup-threads -c)'{-c,--cleanup-threads}'[number of cleanup threads to use]:number of threads [2]' \ '(--process-cache -p)'{-p,--process-cache}'[size of process cache]:cache size:' \ - '(--request-threads -r)'{-r,--request-threads}'[number of request threads to use (default 10)]:number of threads:' \ + '(--request-threads -r)'{-r,--request-threads}'[number of request threads to use]:number of threads [10]' \ '(--debug -d)'{-d,--debug}'[log debug messages to stderr]' \ '(--stderr -e --no-stderr -E)'{-e,--stderr}'[log to stderr (default if stderr is a tty)]' \ '(--stderr -e --no-stderr -E)'{-E,--no-stderr}"[don't log to stderr (see -y, -Y options)]" \ - '(--log-level -l)'{-l,--log-level}'[verbosity of logging (1..7) (default 6)]:verbosity level:({1..7})' \ + '(--log-level -l)'{-l,--log-level}'[specify log verbosity]:verbosity level [6]:({1..7})' \ '(--syslog -y --no-syslog -Y)'{-y,--syslog}'[log to syslog (default if stderr is no tty)]' \ '(--syslog -y --no-syslog -Y)'{-Y,--no-syslog}"[don't log to syslog (see -e, -E options)]" \ '(--no-sharedmem -m)'{-m,--no-sharedmem}"[don't start XSI Shared Memory support]" \ diff --git a/Completion/Debian/Command/_git-buildpackage b/Completion/Debian/Command/_git-buildpackage index c38edc1cc..81bf7dac9 100644 --- a/Completion/Debian/Command/_git-buildpackage +++ b/Completion/Debian/Command/_git-buildpackage @@ -13,14 +13,14 @@ _arguments \ '--git-sign-tags[sign tags]' \ '--git-no-sign-tags[negates --git-sign-tags]' \ '--git-keyid=-[GPG keyid to sign tags with]:GPG key:' \ - '--git-debian-tag=-[format string for debian tags]:default is debian/%(version)s:' \ - '--git-upstream-tag=-[format string for upstream tags]:default is upstream/%(version)s:' \ + '--git-debian-tag=-[format string for debian tags]:format string [debian/%%(version)s]' \ + '--git-upstream-tag=-[format string for upstream tags]:format string [upstream/%%(version)s]' \ '--git-pristine-tar[use pristine-tar to create .orig.tar.gz]' \ '--git-no-pristine-tar[negates --git-pristine-tar]' \ '--git-force-create[force creation of orig.tar.gz]' \ '--git-no-create-orig[do not create orig.tar.gz]' \ '--git-tarball-dir=-[location to look for external tarballs]:tarball directory:_files -/' \ - '--git-compression=-[compression type]:compression:(auto gzip bzip2 lzma xz)' \ + '--git-compression=-[compression type]:compression type [auto]:(auto gzip bzip2 lzma xz)' \ '--git-compression-level=-[set compression level]:level:(1 2 3 4 5 6 7 8 9)' \ '--git-upstream-branch=-[upstream branch]::' \ '--git-debian-branch=-[branch the Debian package is being developed on]::' \ diff --git a/Completion/Linux/Command/_alsa-utils b/Completion/Linux/Command/_alsa-utils index 91bb0b86c..dd5c26866 100644 --- a/Completion/Linux/Command/_alsa-utils +++ b/Completion/Linux/Command/_alsa-utils @@ -38,7 +38,7 @@ opts=( --disable-format'[disable automatic format conversions]' --disable-softvol'[disable software volume control (softvol)]' --test-position'[test ring buffer position]' - --test-coef='[test coefficient for ring buffer position (default 8)]' + --test-coef='[test coefficient for ring buffer position]:coefficient [8]' --test-nowait'[do not wait for ring buffer - eats whole CPU]' --max-file-time='[start another output file when the old file has recorded]' --process-id-file='[write the process ID here]' diff --git a/Completion/Linux/Command/_ipset b/Completion/Linux/Command/_ipset index 061d16799..a40480904 100644 --- a/Completion/Linux/Command/_ipset +++ b/Completion/Linux/Command/_ipset @@ -4,7 +4,7 @@ local offset=0 local -a args from_to hash cmds listopts addopts _set_types () { - _values -S \ "Set type" \ + _values -S \ "set type" \ 'bitmap\:ip[uses a memory range to store IPv4 host (default) or IPv4 subnet addresses up to 65536 elements]'\ 'bitmap\:ip,mac[uses a memory range to store an IPv4 host/subnet and mac address pair up to 65536 elements]'\ 'bitmap\:port[uses a memory range to store port numbers independent of L4 protocol at up to 65536 elements]'\ @@ -37,18 +37,11 @@ from_to=('(--network)--from[from IP or network (with --netmask)]:IP' '(--from --to)--network[network]:IP/mask' ) -_addressfamily () { - vals=( inet - inet6 - ) - _describe -t addressfamily "Address Family" vals -} - -hash=( '--hashsize[the initial hash size aligned to a power of 2(default 1024)]:hashsize' - '--maxelem[the maximum number of elements in the set (default 65536)]:maxelements' - '--family[the protocol family of addresses to be stored in the set (default inet)]:addressfamily:_addressfamily' +hash=( '--hashsize[the initial hash size aligned to a power of 2]:hashsize [1024]' + '--maxelem[the maximum number of elements in the set]:max elements [65536]' + '--family[the protocol family of addresses to be stored in the set]:address family [inet]:(inet inet6)' '--timeout[adds timeout support to the set with your specified value as default, (0 = forever)]:entrytimeout' - '--probes[max number of tries to resolve clashing, altering this is discouraged (default 8)]:probes' + '--probes[max number of tries to resolve clashing, altering this is discouraged]:tries [8]' '--resize[ratio of increasing hash size after unsuccessful of double-hashing, altering discouraged]:percent' ) @@ -100,7 +93,7 @@ case $words[offset+2]; in args=( $hash ) ;; list\:set) - args=( '--size[size of the new setlist (default 8)]:size' ) + args=( '--size[size of the new setlist]:size [8]' ) ;; esac ;; diff --git a/Completion/Solaris/Command/_dtrace b/Completion/Solaris/Command/_dtrace index 6a6636af3..06e0dc4f6 100644 --- a/Completion/Solaris/Command/_dtrace +++ b/Completion/Solaris/Command/_dtrace @@ -12,7 +12,7 @@ case $OSTYPE in '-X+[specify ISO C conformance settings for preprocessor]:ISO C conformance:((a\:"ISO plus K&R extensions (default)" c\:"Strictly conformant ISO C" s\:"K&R C only" t\:"ISO plus K&R extensions"))' ) xopts=( - 'errexit[exit on error with specified status code (default 1)]::status' + 'errexit[exit on error with specified status code]::status [1]' 'noresolve[do not perform user address symbol resolution]' 'uresolve[specify resolution of user addresses]:how:(no symbol basename absolute)' ) diff --git a/Completion/Solaris/Command/_prstat b/Completion/Solaris/Command/_prstat index 1eb38845c..12be9c5a4 100644 --- a/Completion/Solaris/Command/_prstat +++ b/Completion/Solaris/Command/_prstat @@ -9,7 +9,7 @@ _prstat() ) sort_key=( - "cpu"\:"process CPU usage (default)" + "cpu"\:"process CPU usage" "pri"\:"process priority" "rss"\:"resident set size" "size"\:"size of process image" @@ -32,8 +32,8 @@ _prstat() '-p[only processes whose process ID is in the list]:PID list' \ '-P[only processes or lwps which have most recently executed on a CPU in the list]:CPU list' \ '-R[Put prstat in the real time scheduling class]' \ - '-s[Sort key (descending)]:key:(($sort_key))' \ - '-S[Sort key (ascending)]:key:(($sort_key))' \ + '-s[sort key (descending)]:sort key [cpu]:(($sort_key))' \ + '-S[sort key (ascending)]:sort key [cpu]:(($sort_key))' \ '-t[total usage summary for each user]' \ '-T[information about processes and tasks]' \ '-u[only processes whose effective user ID is in the list]:UID:_users' \ diff --git a/Completion/Unix/Command/_adb b/Completion/Unix/Command/_adb index 21cd68761..1375813bb 100644 --- a/Completion/Unix/Command/_adb +++ b/Completion/Unix/Command/_adb @@ -446,8 +446,8 @@ _adb_dispatch_logcat() { _arguments \ '(-c -g)-s[set default filter to silent]' \ '(-c -g)-f[log output to file (defaults to stdout)]:logfile:_files' \ - '(-c -g -d)-r[rotate log every kbytes (default 16, requires -f)]:logsize:_guard "[0-9]#" "numeric value"' \ - '(-c -g -d)-n[max number of rotated logs (default 4)]:number :_guard "[0-9]#" "numeric value"' \ + '(-c -g -d)-r[rotate log at specified size, requires -f]:log size (kbytes) [16]' \ + '(-c -g -d)-n[specify max number of rotated logs]:number [4]' \ '(-c -g -d)-v[log format]:format: _values "format" brief process tag thread raw time threadtime long' \ '(-d -t -g)-c[clear log]' \ '(-c -g)-d[dump log]' \ diff --git a/Completion/Unix/Command/_ant b/Completion/Unix/Command/_ant index 080ce6857..7401c7449 100644 --- a/Completion/Unix/Command/_ant +++ b/Completion/Unix/Command/_ant @@ -56,7 +56,7 @@ _arguments -C \ '-propertyfile[load all properties from specified file with -D properties taking precedence]:property file:_files -g "*.properties(-.)"' \ '-inputhandler[specify class which will handle input requests]:class:->class' \ '(-s -find -f -file -buildfile)'{-s,-find}'[search for specified build file towards the root of filesystem]:build file:(build.xml)' \ - '-nice[specify a niceness value for the main thread]:niceness value (default 5):({1..10})' \ + '-nice[specify a niceness value for the main thread]:niceness value [5]:({1..10})' \ '-nouserlib[run ant without using the jar files from ${user.home}/.ant/lib]' \ '-noclasspath[run ant without using CLASSPATH]' \ '-autoproxy[Java1.5+: use the OS proxy settings]' \ diff --git a/Completion/Unix/Command/_django b/Completion/Unix/Command/_django index 9eaa2284a..1d5cf7311 100644 --- a/Completion/Unix/Command/_django +++ b/Completion/Unix/Command/_django @@ -146,9 +146,9 @@ case $state in args+=( $locale $verbosity - {-d,--domain=}'[domain of the message files (default: "django")]:domain' + {-d,--domain=}'[domain of the message files]:domain [django]:(django djangojs)' {-a,--all}'[re-examine all code and templates]' - {-e,--extensions=}'[file extension(s) to examine (default: ".html")]:extension' + {-e,--extensions=}'[file extension(s) to examine]:extension [html]' ) ;; diff --git a/Completion/Unix/Command/_dtruss b/Completion/Unix/Command/_dtruss index bd1ae8bc5..b56e713d2 100644 --- a/Completion/Unix/Command/_dtruss +++ b/Completion/Unix/Command/_dtruss @@ -2,7 +2,7 @@ _arguments -s : \ '-a[print all details]' \ - '-b+[specify dynamic variable buffer size]:buffer size (default 4m)' \ + '-b+[specify dynamic variable buffer size]:buffer size [4m]' \ '-c[print system call counts]' \ '-d[print relative timestamps]' \ '-e[print elapsed times]' \ diff --git a/Completion/Unix/Command/_gcc b/Completion/Unix/Command/_gcc index 22d3083de..b6f1da2c6 100644 --- a/Completion/Unix/Command/_gcc +++ b/Completion/Unix/Command/_gcc @@ -1643,7 +1643,7 @@ args+=( '+e-[control how virtual function definitions are used]:virtual function definitions in classes:((0\:only\ interface 1\:generate\ code))' {-e,--entry}'[specify program entry point is entry]:entry' {-E,--preprocess}'[preprocess only; do not compile, assemble or link]' - '-fabi-version=-[use version of the C++ ABI (default: 2)]:ABI version:(1 2 3 4 5 6)' + '-fabi-version=-[use specified C++ ABI version]:ABI version [0]:(0 1 2 3 4 5 6 7 8 9 10 11 12 13)' '-fada-spec-parent=[dump Ada specs as child units of given parent]' '-faggressive-loop-optimizations[aggressively optimize loops using language constraints]' '-falign-functions[align the start of functions]' @@ -1737,11 +1737,11 @@ args+=( '-feliminate-unused-debug-types[perform unused type elimination in debug info]' '-femit-class-debug-always[do not suppress C++ class debug information]' '-femit-struct-debug-baseonly[aggressive reduced debug info for structs]' - '-femit-struct-debug-detailed=[detailed reduced debug info for structs]:spec list' + '-femit-struct-debug-detailed=-[detailed reduced debug info for structs]:spec list [all]' '-femit-struct-debug-reduced[conservative reduced debug info for structs]' '-fexceptions[enable exception handling]' '-fexcess-precision=-[specify handling of excess floating-point precision]:precision handling:(fast standard)' - '-fexec-charset=[convert all strings and character constants to character set]:character set' + '-fexec-charset=-[convert all strings and character constants to character set]:character set [UTF-8]' '-fexpensive-optimizations[perform a number of minor, expensive optimizations]' '-fextended-identifiers[permit universal character names in identifiers]' '-ffast-math[sets -fno-math-errno, -funsafe-math-optimizations, -ffinite-math-only, -fno-rounding-math, -fno-signaling-nans and -fcx-limited-range]' @@ -1750,8 +1750,7 @@ args+=( '-ffixed--[mark as being unavailable to the compiler]:register' '-ffloat-store[don'\''t allocate floats and doubles in extended- precision registers]' '-fforward-propagate[perform a forward propagation pass on RTL]' - '-ffp-contract=-[perform floating- point expression contraction (default: fast)]:style:(on off fast)' - '-ffp-contract=[perform floating-point expression contraction]:style:(off on fast)' + '-ffp-contract=-[perform floating-point expression contraction]:style [fast]:(on off fast)' '-ffp-int-builtin-inexact[allow built-in functions ceil, floor, round, trunc to raise "inexact" exceptions]' '-ffreestanding[do not assume that standard C libraries and main exist]' '-ffunction-cse[allow function addresses to be held in registers]' diff --git a/Completion/Unix/Command/_gnupod b/Completion/Unix/Command/_gnupod index f53ae6c59..22ccabb9d 100644 --- a/Completion/Unix/Command/_gnupod +++ b/Completion/Unix/Command/_gnupod @@ -30,8 +30,8 @@ case "$service" in '(-b --set-bookmarkable)'{-b,--set-bookmarkable}'[set this song as bookmarkable (= Remember position)]' --set-shuffleskip'[exclude this file in shuffle-mode]' --set-compilation'[mark songs as being part of a compilation]' - --min-vol-adj='[minimum volume adjustment allowed by ID3v2.4 RVA2 tag (range -100 to 100, default 0)]' - --max-vol-adj='[maximum volume adjustment allowed by ID3v2.4 RVA2 tag (range -100 to 100, default 0)]' + --min-vol-adj='[minimum volume adjustment allowed by ID3v2.4 RVA2 tag]:adjustment (-100..100) [0]' + --max-vol-adj='[maximum volume adjustment allowed by ID3v2.4 RVA2 tag]:adjustment (-100..100) [0]' --artwork='[use FILE as album cover]:artwork:_files' '*:file to add:_files' ) diff --git a/Completion/Unix/Command/_initctl b/Completion/Unix/Command/_initctl index b404c0c16..b60bdbc5b 100644 --- a/Completion/Unix/Command/_initctl +++ b/Completion/Unix/Command/_initctl @@ -157,7 +157,7 @@ _initctl() '--system[talk via DBUS system bus instead of socket]' '(-q --quiet)'{-q,--quiet}'[reduce output to errors only]' '(-v --verbose)'{-v,--verbose}'[increase output to include informational messages]' - '--dest=[D-Bus name for init, defaults to com.ubuntu.Upstart]' + '--dest=[specify D-Bus name for init]:D-Bus name [com.ubuntu.Upstart]' '--help[display help and exit]' '--version[output version information and exit]' ) diff --git a/Completion/Unix/Command/_mysqldiff b/Completion/Unix/Command/_mysqldiff index 52b96ef21..2515834e0 100644 --- a/Completion/Unix/Command/_mysqldiff +++ b/Completion/Unix/Command/_mysqldiff @@ -6,7 +6,7 @@ _mysqldiff () { {-p{,1,2},--password{,1,2}=}':server password: ' \ {-u{,1,2},--user{,1,2}=}':server username:_mysql_users' \ {-s{,1,2},--socket{,1,2}=}':server socket:_directories' \ - {-d,--debug=}':debugging level (default 1):(1 2 3 4 5 6 7 8)' \ + {-d,--debug=}':debugging level [1]:(1 2 3 4 5 6 7 8)' \ {-i,--tolerant}':ignore DEFAULT and formatting changes: ' \ {-k,--keep-old-tables}":don\'t output DROP TABLE commands: " \ {-n,--no-old-defs}"[don't output old defs as comments]" \ diff --git a/Completion/Unix/Command/_pandoc b/Completion/Unix/Command/_pandoc index bdd261322..98e5abc70 100644 --- a/Completion/Unix/Command/_pandoc +++ b/Completion/Unix/Command/_pandoc @@ -134,11 +134,11 @@ _pandoc_top_level_division(){ _pandoc_email_obfusication(){ local -a policies policies=( - 'none:(default) leaves mailto: links as they are' + 'none:leave mailto: links as they are' 'javascript:obfuscates them using JavaScript' 'references:obfuscates them by printing their letters as decimal or hexadecimal character references' ) - _describe 'obfusication' policies + _describe 'obfuscation policy [none]' policies } # choose wrapping policy @@ -146,11 +146,11 @@ _pandoc_email_obfusication(){ _pandoc_wrap() { local -a policies policies=( - 'auto:(default) wrap lines to the column width specified by --columns (default 72)' + 'auto:wrap lines to the column width specified by --columns (default 72)' "none:don't wrap lines at all" 'preserve:attempt to preserve the wrapping from the source document' ) - _describe 'policy' policies + _describe 'policy [auto]' policies } # choose eol policy @@ -170,11 +170,11 @@ _pandoc_eol() { _pandoc_track_changes() { local -a policies policies=( - 'accept:(default) inserts all insertions, and ignores all deletions' + 'accept:insert all insertions, and ignore all deletions' 'reject:inserts all deletions and ignores insertions' 'all:puts in insertions, deletions, and comments, wrapped in spans with insertion, deletion, comment-start, and comment-end classes, respectively' ) - _describe 'policy' policies + _describe 'policy [accept]' policies } # The real thing @@ -185,7 +185,7 @@ _arguments -s \ '--data-dir=[specify the user data directory to search for pandoc data files]:data directory:_files -/' \ {-d+,--defauls=}'[read default from YAMAL file]: :_pandoc_defaults_file' \ '--shift-heading-level-by=[shift heading levels by specified number]:positive or negative integer: ' \ - '!--base-header-level=[(deprecated) specify the base level for headers]:number (default 1):(1 2 3 4 5)' \ + '!--base-header-level=:number [1]:(1 2 3 4 5)' \ '!--strip-empty-paragraphs[deprecated. Use the +empty_paragraphs extension instead]' \ '--indented-code-classes=[classes to use for indented code blocks]:class:{_message "Classes separated with ,"}' \ '--default-image-extension=[specify a default extension to use when image paths/URLs have no extension]:extension: ' \ @@ -195,7 +195,7 @@ _arguments -s \ {\*-M+,\*--metadata=}'[set the metadata field KEY to the value VALUE]:key\:value: ' \ '*--metadata_file=[read metadata from file]:YAML or JSON file:_files' \ {-p,--preserve-tabs}'[preserve tabs instead of converting them to spaces]' \ - '--tab-stop=[specify the number of spaces per tab (default is 4)]:number:{_message -r "choose a number equals to or greater then 1"}' \ + '--tab-stop=[specify the number of spaces per tab]:spaces [4]' \ '--track-changes=[specifies what to do with insertions, deletions, and comments produced by the MS Word "Track Changes" feature]: :_pandoc_track_changes' \ '--extract-media=[extract media in source document to specified directory]:directory:_files -/' \ '--abbreviations=[specifies a custom abbreviations file]:file:_files ' \ @@ -207,7 +207,7 @@ _arguments -s \ '--eol=[manually specify line endings (crlf|lf|native)]: :_pandoc_eol' \ '--dpi=[specify the dpi (dots per inch) value for conversion from pixels to inch/centimeters and vice versa]:number: ' \ '--wrap=[determine how text is wrapped in the output (the source code, not the rendered version)]: :_pandoc_wrap ' \ - '--columns=[specify length of lines in characters (default 72)]:number: ' \ + '--columns=[specify length of lines in characters]:length [72]' \ {--toc,--table-of-contents}'[include an automatically generated table of contents]' \ '--toc-depth=[specify the number of section levels to include in the table of contents]:number:{_message -r "choose a number equals to or greater then 1"}' \ '--strip-comments[strip out HTML comments in the Markdown or Textile source]' \ @@ -226,11 +226,11 @@ _arguments -s \ '--ascii[use only ASCII characters in output, supported only for HTML and DocBook output]' \ '--reference-links[use reference-style links, rather than inline links]' \ '--reference-location=[specify where footnotes (and references, if reference-links is set) are placed (block|section|document)]: :_pandoc_reference_location' \ - '--markdown-headings[specify style for level1 and 2 headings in markdown output]:style (default atx):(setext atx)' \ + '--markdown-headings[specify style for level1 and 2 headings in markdown output]:style [atx]:(setext atx)' \ '!--atx-headers[use ATX-style headers in Markdown and AsciiDoc output]' \ '--top-level-division=[treat top-level headers as the given division type in LaTeX, ConTeXt, DocBook, and TEI output]: :_pandoc_top_level_division' \ {-N,--number-sections}'[number section headings in LaTeX, ConTeXt, HTML, or EPUB output]' \ - '--number-offset=[offset for section headings in HTML output (ignored in other output formats)]:number[number,...] (default 0): ' \ + '--number-offset=[offset for section headings in HTML output (ignored in other output formats)]:number[number,...] [0]' \ '--listings[use the listings package for LaTeX code blocks]' \ {-i,--incremental}'[make list items in slide shows display incrementally (one by one)]' \ '--slide-level=[specifies that headers with the specified level create slides (for beamer, s5, slidy, slideous, dzslides)]:slide level:(1 2 3 4 5 6)' \ diff --git a/Completion/Unix/Command/_pbm b/Completion/Unix/Command/_pbm index 62004f79e..8b5576c5f 100644 --- a/Completion/Unix/Command/_pbm +++ b/Completion/Unix/Command/_pbm @@ -740,7 +740,7 @@ ppmtomitsu) _arguments \ '-sharpness:sharpness:(1 2 3 4)' \ '-enlarge:enlargement factor:(1 2 3)' \ - '-media:output media (default\: 1184x1350):((A\:1216x1350 A4\:1184x1452 AS\:1216x1650 A4S\:1184x1754))' \ + '-media:output media [1184x1350]:((A\:1216x1350 A4\:1184x1452 AS\:1216x1650 A4S\:1184x1754))' \ '-copy:number of copies:(1 2 3 4 5 6 7 8 9)' \ -{dpi300,tiny} ':file:_pbm' ;; diff --git a/Completion/Unix/Command/_perforce b/Completion/Unix/Command/_perforce index 4e69dee78..cb6cdb79f 100644 --- a/Completion/Unix/Command/_perforce +++ b/Completion/Unix/Command/_perforce @@ -2551,7 +2551,7 @@ _perforce_cmd_logstat() { (( $+functions[_perforce_cmd_logtail] )) || _perforce_cmd_logtail() { _arguments -s : \ - '-b[specify block size, default 8192]:block size: ' \ + '-b[specify block size]:block size [8192]' \ '-s[specify start offset]:offset: ' \ '-m[specify max blocks]:max blocks: ' } diff --git a/Completion/Unix/Command/_qemu b/Completion/Unix/Command/_qemu index 30fcd6757..7bc02c30c 100644 --- a/Completion/Unix/Command/_qemu +++ b/Completion/Unix/Command/_qemu @@ -19,8 +19,8 @@ _arguments \ '-boot[specify which image to boot from]:boot device:((a\:floppy\ image\ a c\:hard\ disk d\:cdrom))' \ '-snapshot[write to temporary files instead of disk image files]' \ '-no-fd-bootchk[disable boot sig checking for floppies in Bochs BIOS]' \ - '-m[virtual RAM size (default=128)]:megs:' \ - '-smp[set the number of CPUs (default=1)]:number of CPUs:' \ + '-m[specify virtual RAM size]:size (MB) [128]' \ + '-smp[set the number of CPUs]:number of CPUs [1]' \ '-nographic[disable graphical output]' \ '-vnc[listen on VNC display]:display:' \ '-k[use keyboard layout]:keyboard layout language:(ar de-ch es fo fr-ca hu ja mk no pt-br sv da en-gb et fr fr-ch is lt nl pl ru th de en-us fi fr-be hr it lv nl-be pt sl tr)' \ diff --git a/Completion/Unix/Command/_ruby b/Completion/Unix/Command/_ruby index 3ed25a3f0..a57bffcda 100644 --- a/Completion/Unix/Command/_ruby +++ b/Completion/Unix/Command/_ruby @@ -21,7 +21,7 @@ common=( ) opts=( - '-0-[specify record separator]:input record separator in octal [default \0]' + '-0-[specify record separator]:input record separator in octal [\0]' '-a[autosplit mode with -n or -p (splits $_ into $F)]' '-c[check syntax only]' '-C+[cd to directory before executing your script]:directory:_files -/' diff --git a/Completion/Unix/Command/_tidy b/Completion/Unix/Command/_tidy index 3998ccdb3..35ceb7e51 100644 --- a/Completion/Unix/Command/_tidy +++ b/Completion/Unix/Command/_tidy @@ -12,7 +12,7 @@ opts=( ${(M)opts:#*:*} ) _arguments -s -A "-*" --$^opts \ '(-indent -i)'{-indent,-i}'[indent element content]' \ - '-wrap[wrap text at the specified (default is 68)]:column:' \ + '-wrap[wrap text at the specified column]:column [68]' \ '(-upper -u)'{-upper,-u}'[force tags to upper case (default is lower case)]' \ '(-clean -c)'{-clean,-c}'[replace FONT, NOBR and CENTER tags by CSS]' \ '(-bare -b)'{-bare,-b}'[strip out smart quotes and em dashes, etc.]' \ diff --git a/Completion/Unix/Command/_w3m b/Completion/Unix/Command/_w3m index 8b45ad730..eff9901ca 100644 --- a/Completion/Unix/Command/_w3m +++ b/Completion/Unix/Command/_w3m @@ -8,7 +8,7 @@ typeset -A opt_args _arguments -C \ '-t[set tab width]:tab width:' \ '-r[ignore backspace effect]' \ - '-l[specify number of preserved lines]:number of lines (default 10000):' \ + '-l[specify number of preserved lines]:number of lines [10000]' \ '-I[document charset]:charset:->charset' \ '-O[display/output charset]:charset:->charset' \ '( -s -j)-e[EUC-JP]' \ diff --git a/Completion/X/Command/_vnc b/Completion/X/Command/_vnc index 9263ab930..7d818cfe7 100644 --- a/Completion/X/Command/_vnc +++ b/Completion/X/Command/_vnc @@ -65,10 +65,10 @@ case $service in '-rfbauth[use authentication on RFB protocol]:passwd-file:_files' \ '-httpd[serve files via HTTP from here]:dir:_files -/' \ '-httpport[port for HTTP]:port:' \ - '-deferupdate[time in ms to defer updates (default 40)]:time (ms):' \ + '-deferupdate[specify time to defer updates by]:time (ms) [40]' \ '-economictranslate[less memory-hungry translation]' \ '-lazytight[disable "gradient" filter in tight encoding]' \ - '-desktop[VNC desktop name (default x11)]:name:' \ + '-desktop[specify VNC desktop name]:name [x11]' \ '-alwaysshared[always treat new clients as shared]' \ '-nevershared[never treat new clients as shared]' \ "-dontdisconnect[don't disconnect existing clients for new non-shared connections]" \ diff --git a/Completion/X/Command/_xdvi b/Completion/X/Command/_xdvi index d55c99485..c33e67bcc 100644 --- a/Completion/X/Command/_xdvi +++ b/Completion/X/Command/_xdvi @@ -9,7 +9,7 @@ _xt_arguments \ '-cr:cursor color:_x_color' \ '-debug:debugging bitmask:((1\:bitmaps 2\:dvi\ translation 4\:pk\ reading 8\:batch\ operation 16\:events 32\:file\ opening 64\:PostScript\ communication 128\:Kpathsea\ statistics 256\:Kpathsea\ hash\ table\ lookups 512\:Kpathsea\ path\ definitions 1024\:Kpathsea\ path\ expansion 2048\:Kpathsea\ searches))' \ '-density:font shrink density' \ - '-gamma:anti-aliasing factor (default 1.0)' \ + '-gamma:anti-aliasing factor [1.0]' \ -grid{1,2,3}':grid color:_x_color' \ '-gspalette:Ghostscript palette:(Color Greyscale Monochrome)' \ '-hl:page highlight color:_x_color' \ -- cgit v1.2.3 From cd89e1937daa9dcfa6b372ec56018904c0f34581 Mon Sep 17 00:00:00 2001 From: DCsunset Date: Wed, 18 Aug 2021 13:37:12 -0400 Subject: github #78: Fix completions in _pandoc --- ChangeLog | 5 +++++ Completion/Unix/Command/_pandoc | 6 +++--- 2 files changed, 8 insertions(+), 3 deletions(-) (limited to 'Completion/Unix/Command/_pandoc') diff --git a/ChangeLog b/ChangeLog index 09bfe7839..3d1a97e41 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2021-08-24 dana + + * github #78: DCsunset: Completion/Unix/Command/_pandoc: Fix + completions in _pandoc + 2021-08-16 Oliver Kiddle * 49268: Completion/Unix/Command/_texinfo: use an empty string search diff --git a/Completion/Unix/Command/_pandoc b/Completion/Unix/Command/_pandoc index 98e5abc70..e694606c0 100644 --- a/Completion/Unix/Command/_pandoc +++ b/Completion/Unix/Command/_pandoc @@ -183,7 +183,7 @@ _arguments -s \ {-t+,-w+,--to=,--write=}'[specify output format]: :_pandoc_format -T output' \ {-o+,--output=}'[write output to FILE instead of stdout]:file:_files' \ '--data-dir=[specify the user data directory to search for pandoc data files]:data directory:_files -/' \ - {-d+,--defauls=}'[read default from YAMAL file]: :_pandoc_defaults_file' \ + {-d+,--defaults=}'[read default from YAML file]: :_pandoc_defaults_file' \ '--shift-heading-level-by=[shift heading levels by specified number]:positive or negative integer: ' \ '!--base-header-level=:number [1]:(1 2 3 4 5)' \ '!--strip-empty-paragraphs[deprecated. Use the +empty_paragraphs extension instead]' \ @@ -193,7 +193,7 @@ _arguments -s \ {\*-F+,\*--filter=}'[specify an executable to be used as a filter transforming the pandoc AST after the input is parsed and before the output is written]: :_pandoc_filter' \ {\*-L+,\*--lua-filter=}"[transform the document by using pandoc's built-in lua filtering system]: :_pandoc_lua_filter" \ {\*-M+,\*--metadata=}'[set the metadata field KEY to the value VALUE]:key\:value: ' \ - '*--metadata_file=[read metadata from file]:YAML or JSON file:_files' \ + '*--metadata-file=[read metadata from file]:YAML or JSON file:_files' \ {-p,--preserve-tabs}'[preserve tabs instead of converting them to spaces]' \ '--tab-stop=[specify the number of spaces per tab]:spaces [4]' \ '--track-changes=[specifies what to do with insertions, deletions, and comments produced by the MS Word "Track Changes" feature]: :_pandoc_track_changes' \ @@ -264,7 +264,7 @@ _arguments -s \ '--verbose[give verbose debugging output]' \ '--quiet[suppress warning messages]' \ '--fail-if-warnings[exit with error status if there are any warnings]' \ - '--log=[write log messages in machine-readable JSON format to FILE]:file:_file' \ + '--log=[write log messages in machine-readable JSON format to FILE]:file:_files' \ '(- :)--bash-completion[generate a bash completion script]' \ '(- :)--list-input-formats[list supported input formats, one per line]' \ '(- :)--list-output-formats[list supported output formats, one per line]' \ -- cgit v1.2.3 From f529d54f43bdf277be157b5638d89f81cb93a2ee Mon Sep 17 00:00:00 2001 From: Oliver Kiddle Date: Sun, 29 Aug 2021 17:00:05 +0200 Subject: 49316: add (-.) glob qualifier to globs where only files are applicable --- ChangeLog | 5 +++++ Completion/Unix/Command/_bittorrent | 2 +- Completion/Unix/Command/_go | 2 +- Completion/Unix/Command/_pandoc | 20 ++++++++++---------- Completion/Unix/Command/_transmission | 2 +- Completion/X/Command/_pdftk | 6 ++---- 6 files changed, 20 insertions(+), 17 deletions(-) (limited to 'Completion/Unix/Command/_pandoc') diff --git a/ChangeLog b/ChangeLog index 04ca8e172..1bd7f511a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2021-08-29 Oliver Kiddle + * 49316: Completion/Unix/Command/_transmission, + Completion/Unix/Command/_bittorrent, Completion/Unix/Command/_go, + Completion/Unix/Command/_pandoc, Completion/X/Command/_pdftk: + add (-.) glob qualifier to globs where only files are applicable + * 49315: Completion/Unix/Command/_transmission, Completion/Debian/Command/_dak, Completion/Linux/Command/_tpb, Completion/Mandriva/Command/_urpmi, Completion/Unix/Command/_cpio, diff --git a/Completion/Unix/Command/_bittorrent b/Completion/Unix/Command/_bittorrent index 1f305a1c0..1fbab35ef 100644 --- a/Completion/Unix/Command/_bittorrent +++ b/Completion/Unix/Command/_bittorrent @@ -69,7 +69,7 @@ case $service in '--piece_size_pow2+[specify power of 2 to set the piece size to]:power:' \ "--comment+[specify human-readable comment to put in .torrent]:comment:"\ "--target+[specify target file for the torrent]:file:_files"\ - ':file:_files -g "*"' + ':file:_files' return ;; diff --git a/Completion/Unix/Command/_go b/Completion/Unix/Command/_go index 30a2bf88f..0b4b16dfa 100644 --- a/Completion/Unix/Command/_go +++ b/Completion/Unix/Command/_go @@ -15,4 +15,4 @@ case $service in ;; esac -_wanted files expl "input file" _files -g "$pat" +_wanted files expl "input file" _files -g "$pat(-.)" diff --git a/Completion/Unix/Command/_pandoc b/Completion/Unix/Command/_pandoc index e694606c0..464859655 100644 --- a/Completion/Unix/Command/_pandoc +++ b/Completion/Unix/Command/_pandoc @@ -67,7 +67,7 @@ _pandoc_template(){ local format=${${(v)opt_args[(i)(-t|--to|-w|--write)]}%%(+|-)*} [[ -z $format ]] && format=${(v)opt_args[(i)(-o|--output)]:e} local pat="'*'" # or '*.*' ? - [[ -n $format ]] && pat="'*.$format'" + [[ -n $format ]] && pat="'*.$format(-.)'" local template_dir=$(_pandoc_default_dir)/templates _alternative \ "local-templates:local template:_files -g $pat" \ @@ -80,7 +80,7 @@ _pandoc_template(){ _pandoc_highlight_style(){ _alternative \ 'styles:style:( $(pandoc --list-highlight-styles) )' \ - 'style-files:style file:_files -g "*.theme"' + 'style-files:style file:_files -g "*.theme(-.)"' } # filter file in $PWD, data-dir/filters/ or $PATH @@ -98,8 +98,8 @@ _pandoc_filter(){ _pandoc_lua_filter(){ local filters_dir=$(_pandoc_default_dir)/filters _alternative \ - 'local-filters:local filter:_files -g "*.lua"' \ - 'data-dir-filters:filter in data-dir:_files -W filters_dir -g "*.lua"' + 'local-filters:local filter:_files -g "*.lua(-.)"' \ + 'data-dir-filters:filter in data-dir:_files -W filters_dir -g "*.lua(-.)"' } # default file in $PWD or data-dir/defaults/ @@ -107,8 +107,8 @@ _pandoc_lua_filter(){ _pandoc_defaults_file() { local defaults_dir=$(_pandoc_default_dir)/defaults _alternative \ - 'local-defaults:default file:_files -g "*.yaml"' \ - 'data-dir-defaults:default in data-dir:_files -W defaults_dir -g "*.yaml"' + 'local-defaults:default file:_files -g "*.yaml(-.)"' \ + 'data-dir-defaults:default in data-dir:_files -W defaults_dir -g "*.yaml(-.)"' } # choose reference location @@ -214,7 +214,7 @@ _arguments -s \ '--no-highlight[disables syntax highlighting for code blocks and inlines]' \ '--highlight-style=[specifies the coloring style to be used in highlighted source code]:style|file:_pandoc_highlight_style' \ '(- :)--print-highlight-style=[prints a JSON version of a highlighting style]: :_pandoc_highlight_style' \ - '--syntax-definition=[load a KDE XML syntax definition file]:file:{_files -g "*.xml"}' \ + '--syntax-definition=[load a KDE XML syntax definition file]:file:_files -g "*.xml(-.)"' \ {\*-H+,\*--include-in-header=}'[include contents of FILE, verbatim, at the end of the header, implies --standalone]:file:_files' \ {\*-B+,\*--include-before-body=}'[include contents of FILE, verbatim, at the beginning of the document body, implies --standalone]:file:_files' \ {\*-A+,\*--include-end-body=}'[include contents of FILE, verbatim, at the end of the document body, implies --standalone]:file:_files' \ @@ -242,14 +242,14 @@ _arguments -s \ '--reference-doc=[use the specified file as a style reference in producing a docx or ODT file]:file: ' \ '--epub-subdirectory=[specify the subdirectory in the OCF container that is to hold the EPUB-specific contents]:directory:_files -/' \ '--epub-cover-image=[use the specified image as the EPUB cover]:file:_files' \ - '--epub-metadata=[look in the specified XML file for metadata for the EPUB]:file:{_files -g "*.xml"}' \ + '--epub-metadata=[look in the specified XML file for metadata for the EPUB]:file:_files -g "*.xml(-.)"' \ '*--epub-embed-font=[embed the specified font in the EPUB]:file:_files ' \ '--epub-chapter-level=[specify the header level at which to split the EPUB into separate "chapter" files]:number:(1 2 3 4 5 6)' \ '--ipynb-output=[specify how to tread ipynb output cells]:method:(all none best)' \ '--pdf-engine=[use the specified engine when producing PDF output]:program:_pandoc_pdf_engine' \ '*--pdf-engine-opt=[use the given string as a command-line argument to the pdf-engine]:string:_pandoc_pdf_engine_opts' \ - '*--bibliography=[set the bibliography field in the document'"'"'s metadata to FILE]:file:{_files -g "*.(bib|bibtex|copac|json|yaml|enl|xml|wos|medline|mods|ris)"}' \ - '--csl=[set the csl field in the document'"'"'s metadata to FILE]:file:{_files -g "*.csl"}' \ + "*--bibliography=[set the bibliography field in the document's metadata to specified file]:file:_files -g '*.(bib|bibtex|copac|json|yaml|enl|xml|wos|medline|mods|ris)(-.)'" \ + "--csl=[set the csl field in the document's metadata to specified file]:file:_files -g '*.csl(-.)'" \ '--citation-abbreviations=[set the citation-abbreviations field in the document'"'"'s metadata to FILE]:file:_files' \ '--natbib[use natbib for citations in LaTeX output]' \ '--biblatex[use biblatex for citations in LaTeX output]' \ diff --git a/Completion/Unix/Command/_transmission b/Completion/Unix/Command/_transmission index c060cbae3..9b7309fe2 100644 --- a/Completion/Unix/Command/_transmission +++ b/Completion/Unix/Command/_transmission @@ -114,7 +114,7 @@ _transmission-remote_days(){ (( $+functions[_transmission-remote_add] )) || _transmission-remote_add(){ _alternative \ - 'args:torrent:_files -g ".torrent"' \ + 'args:torrent:_files -g ".torrent(-.)"' \ 'args:url:_urls' } # complete torrents diff --git a/Completion/X/Command/_pdftk b/Completion/X/Command/_pdftk index 1ac3223f7..b26deb15f 100644 --- a/Completion/X/Command/_pdftk +++ b/Completion/X/Command/_pdftk @@ -34,13 +34,11 @@ case $words[CURRENT-1] in ;; (fill_form) - _description files expl 'FDF and XFDF file' - _files "$@" $expl -g '(#i)*.(fdf|xfdf)' + _wanted files expl 'FDF or XFDF file' _files -g '(#i)*.(fdf|xfdf)(-.)' ;; ((multibackground|background|stamp|multistamp|output)) - _description files expl 'PDF file' - _files "$@" $expl -g '(#i)*.pdf' + _pdf ;; (update_info) -- cgit v1.2.3 From 12676c0f9fd670556a81625f23205d832a95fb17 Mon Sep 17 00:00:00 2001 From: Oliver Kiddle Date: Sun, 29 Aug 2021 17:05:39 +0200 Subject: 49317: cleanup inappropriate use of {...} specs with _arguments or _alternative --- ChangeLog | 5 ++++ Completion/Unix/Command/_gcore | 2 +- Completion/Unix/Command/_luarocks | 48 +++++++++++++++++------------------ Completion/Unix/Command/_pandoc | 4 +-- Completion/Unix/Command/_transmission | 6 ++--- 5 files changed, 35 insertions(+), 30 deletions(-) (limited to 'Completion/Unix/Command/_pandoc') diff --git a/ChangeLog b/ChangeLog index 1bd7f511a..b4da80748 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2021-08-29 Oliver Kiddle + * 49317: Completion/Unix/Command/_transmission, + Completion/Unix/Command/_gcore, Completion/Unix/Command/_pandoc, + Completion/Unix/Command/_luarocks: cleanup inappropriate use + of {...} specs with _arguments or _alternative + * 49316: Completion/Unix/Command/_transmission, Completion/Unix/Command/_bittorrent, Completion/Unix/Command/_go, Completion/Unix/Command/_pandoc, Completion/X/Command/_pdftk: diff --git a/Completion/Unix/Command/_gcore b/Completion/Unix/Command/_gcore index 913ef25ca..a31a81267 100644 --- a/Completion/Unix/Command/_gcore +++ b/Completion/Unix/Command/_gcore @@ -55,7 +55,7 @@ case $OSTYPE in '-v[report progress on the dump as it proceeds]' \ '-b+[specify maximum size of core file]:size (MiB): ' \ '(-c)-o+[write core file to specified file]:file:_files' \ - '(-o)-c+[specify format of core file name]:format:{_message "%%N\:program name, %%U\:uid, %%P\:pid, %%T\:time stamp"}' \ + '(-o)-c+[specify format of core file name]:format (%%N\:program name, %%U\:uid, %%P\:pid, %%T\:time stamp)' \ '1:pid:_pids' ;; *) diff --git a/Completion/Unix/Command/_luarocks b/Completion/Unix/Command/_luarocks index 0915765dc..42169c22a 100644 --- a/Completion/Unix/Command/_luarocks +++ b/Completion/Unix/Command/_luarocks @@ -34,8 +34,8 @@ local option_deps_modes='--deps-mode=[specify how to handle dependencies]:mode:_ local rockspec_options=( '--license=[specify a license string]:license (e.g. "MIT/X11" or "GNU GPL v3")' - '--summary=[a short one-line description summary]:summary:{_message -e "short summary of the rock"}' - '--detailed=[a longer description string]:detailed_text:{_message -e "detailed description of the rock"}' + '--summary=[a short one-line description summary]:summary' + '--detailed=[a longer description string]:detailed description' '--homepage=[project homepage]:URL:_urls' '--lua-versions=[specify supported Lua versions]:lua version:_sequence compadd - 5.{1,2,3,4}' '--rockspec-format=[rockspec format version, such as "1.0" or "1.1"]:VER: ' @@ -321,7 +321,7 @@ __luarocks_rock(){ continue ;; (rockpack) - alts+=(':rock file:{_files -g "*.src.rock(-.)"}') + alts+=( ':rock file:_files -g "*.src.rock(-.)"' ) shift 1 continue ;; @@ -332,7 +332,7 @@ __luarocks_rock(){ ;; (installed) tree="$2" - alts+=(":local rock:{__luarocks_installed_rocks ${tree}}") + alts+=(":local rock: __luarocks_installed_rocks ${tree}") if [[ -z "${tree}" ]]; then shift else @@ -364,7 +364,7 @@ __luarocks_git_tags(){ local make_command_options=( '--pack-binary-rock[produce a .rock file with the contents of compilation inside the current directory instead of installing it]' '--keep[do not remove previously installed versions of the rock after building a new one]' - '--branch=[override the `source.branch` field in the loaded rockspec]:NAME:{_message "branch name"}' + '--branch=[override the `source.branch` field in the loaded rockspec]:branch name' ) local build_command_options=( "${make_command_options[@]}" @@ -375,8 +375,8 @@ local build_command_options=( _luarocks_build(){ _arguments -A "-*" \ "${build_command_options[@]}" \ - '1: :{__luarocks_rock "rockspec" "external"}' \ - '2:: :{__luarocks_rock_version "external_or_local"}' + '1: : __luarocks_rock "rockspec" "external"' \ + '2:: : __luarocks_rock_version "external_or_local"' } # arguments: # - must: option @@ -402,7 +402,7 @@ local doc_command_options=( _luarocks_doc(){ _arguments \ "${doc_command_options[@]}" \ - "1: :{__luarocks_rock installed ${opt_args[--tree]}}" + "1: : __luarocks_rock installed ${opt_args[--tree]}" } # arguments: # - must: external only rockspec @@ -416,14 +416,14 @@ local download_command_options=( _luarocks_download(){ _arguments -A "-*" \ "${download_command_options[@]}" \ - '1: :{__luarocks_rock "external"}' \ - '2:: :{__luarocks_rock_version "external_or_local"}' + '1: : __luarocks_rock "external"' \ + '2:: : __luarocks_rock_version "external_or_local"' } # arguments: # must: luarocks sub command (( $+functions[_luarocks_help] )) || _luarocks_help(){ - _arguments '1: :__luarocks_command' + _arguments '1: : __luarocks_command' } (( $+functions[_luarocks_init] )) || @@ -446,7 +446,7 @@ _luarocks_install(){ # - must: rockspec file (first and last) (( $+functions[_luarocks_lint] )) || _luarocks_lint(){ - _arguments '1:: :{__luarocks_rock "rockspec"}' + _arguments '1:: : __luarocks_rock "rockspec"' } # arguments: # NOTE: receives only options @@ -463,7 +463,7 @@ _luarocks_list(){ # NOTE: it's options were already described above. (( $+functions[_luarocks_make] )) || _luarocks_make(){ - _arguments '1:: :{__luarocks_rock "rockspec"}' + _arguments '1:: : __luarocks_rock "rockspec"' } # arguments: # - optional: .rockspec file / external rock @@ -476,8 +476,8 @@ local new_version_command_options=( _luarocks_new_version(){ _arguments -A "-*" \ "${new_version_command_options[@]}" \ - '1:: :{__luarocks_rock "external" "rockspec"}' \ - '2:: :{__luarocks_rock_version "external_or_local"}' \ + '1:: : __luarocks_rock "external" "rockspec"' \ + '2:: : __luarocks_rock_version "external_or_local"' \ '3:: :_urls' } # arguments: @@ -524,8 +524,8 @@ local remove_command_options=( _luarocks_remove(){ _arguments -A "-*" \ "${remove_command_options[@]}" \ - "1: :{__luarocks_rock installed ${opt_args[--tree]}}" \ - "2:: :{__luarocks_rock_version installed ${opt_args[--tree]}}" + "1: : __luarocks_rock installed ${opt_args[--tree]}" \ + "2:: : __luarocks_rock_version installed ${opt_args[--tree]}" } # arguments: # - must: string as a search query @@ -558,8 +558,8 @@ local show_command_options=( _luarocks_show(){ _arguments \ "${show_command_options[@]}" \ - "1: :{__luarocks_rock installed "${opt_args[--tree]}"}" \ - "2:: :{__luarocks_rock_version installed ${opt_args[--tree]}}" + "1: : __luarocks_rock installed "${opt_args[--tree]}"" \ + "2:: : __luarocks_rock_version installed ${opt_args[--tree]}" } (( $+functions[_luarocks_test] )) || @@ -567,7 +567,7 @@ _luarocks_test(){ _arguments $option_deps_modes \ '--test-type=[specify the test suite type manually]:test suite type' \ '--reset[regenerate files if they already exist]' \ - '1:rockspec:__luarocks_rock' \ + '1: : __luarocks_rock' \ '*:arg' } @@ -581,7 +581,7 @@ local unpack_command_options=( _luarocks_unpack(){ _arguments \ "${unpack_command_options[@]}" \ - '1: :{__luarocks_rock "rockpack" "external"}' + '1: : __luarocks_rock "rockpack" "external"' } # arguments: # - must: rockspec file @@ -595,7 +595,7 @@ local upload_command_options=( _luarocks_upload(){ _arguments \ "${upload_command_options[@]}" \ - '1: :{__luarocks_rock "rockspec"}' + '1: : __luarocks_rock "rockspec"' } (( $+functions[_luarocks_which] )) || @@ -609,8 +609,8 @@ _luarocks_write_rockspec(){ "${rockspec_options[@]}" \ '--output=[write the rockspec with the given file]:file:_files' \ '--tag=[specify tag to use. Will attempt to extract version number from it]:tag:__git_tag' \ - '1:: :{_message "new rock name"}' \ - '2:: :{__luarocks_rock_version "new_rock"}' \ + '1::new rock name' \ + '2:: : __luarocks_rock_version "new_rock"' \ '3:: :_urls' } diff --git a/Completion/Unix/Command/_pandoc b/Completion/Unix/Command/_pandoc index 464859655..b0fff80d6 100644 --- a/Completion/Unix/Command/_pandoc +++ b/Completion/Unix/Command/_pandoc @@ -187,7 +187,7 @@ _arguments -s \ '--shift-heading-level-by=[shift heading levels by specified number]:positive or negative integer: ' \ '!--base-header-level=:number [1]:(1 2 3 4 5)' \ '!--strip-empty-paragraphs[deprecated. Use the +empty_paragraphs extension instead]' \ - '--indented-code-classes=[classes to use for indented code blocks]:class:{_message "Classes separated with ,"}' \ + '--indented-code-classes=[classes to use for indented code blocks]:class list (comma-separated)' \ '--default-image-extension=[specify a default extension to use when image paths/URLs have no extension]:extension: ' \ '--file-scope[parse each file individually before combining for multifile documents]' \ {\*-F+,\*--filter=}'[specify an executable to be used as a filter transforming the pandoc AST after the input is parsed and before the output is written]: :_pandoc_filter' \ @@ -209,7 +209,7 @@ _arguments -s \ '--wrap=[determine how text is wrapped in the output (the source code, not the rendered version)]: :_pandoc_wrap ' \ '--columns=[specify length of lines in characters]:length [72]' \ {--toc,--table-of-contents}'[include an automatically generated table of contents]' \ - '--toc-depth=[specify the number of section levels to include in the table of contents]:number:{_message -r "choose a number equals to or greater then 1"}' \ + '--toc-depth=[specify the number of section levels to include in the table of contents]:number' \ '--strip-comments[strip out HTML comments in the Markdown or Textile source]' \ '--no-highlight[disables syntax highlighting for code blocks and inlines]' \ '--highlight-style=[specifies the coloring style to be used in highlighted source code]:style|file:_pandoc_highlight_style' \ diff --git a/Completion/Unix/Command/_transmission b/Completion/Unix/Command/_transmission index 9b7309fe2..a640f3dd7 100644 --- a/Completion/Unix/Command/_transmission +++ b/Completion/Unix/Command/_transmission @@ -65,9 +65,9 @@ local global_only_actions=( ) # `torrent_add_options`: *options* that can be used only when *adding* a torrent local torrent_add_options=( - '(-C --no-incomplete-dir)'{-c+,--incomplete-dir=}'[when adding new torrents, store their contents in directory until the torrent is done]:dir:{_files -/}' + '(-C --no-incomplete-dir)'{-c+,--incomplete-dir=}'[when adding new torrents, store their contents in directory until the torrent is done]:directory:_directories' '(-c --incomplete-dir)'{-C,--no-incomplete-dir}'[don'"'"'t store incomplete torrents in a different directory]' - {-w+,--download-dir=}'[when used in conjunction with --add, set the new torrent'"'"'s download folder]:dir:{_files -/}' + {-w+,--download-dir=}"[when used in conjunction with --add, set the new torrent's download directory]:directory:_directories" ) # `torrent_action_only_actions`: *actions* that can be specified only when explicitly selecting a specific set of torrents local torrent_action_only_actions=( @@ -88,7 +88,7 @@ local torrent_action_only_actions=( {-r,--remove}'[remove the current torrent(s) without deleting the downloaded data]' {-rad,--remove-and-delete}'[remove the current torrent(s) and delete the downloaded data]' '--reannounce[reannounce the current torrent(s)]' - '--move[move the current torrents'"'"' data from their current locations to the specified directory]:{_files -/}' + "--move[move the current torrents' data from their current locations to the specified directory]:directory:_directories" {-sr+,--seedratio=}'[let the current torrent(s) seed until a specific ratio]:ratio' {-SR,--no-seedratio}'[let the current torrent(s) use the global seedratio settings]' {-hl,--honor-session}'[make the current torrent(s) honor the session limits]' -- cgit v1.2.3