From 1ae4ab5dc2c57babe8f1cfad847c9c2ff6bdf82e Mon Sep 17 00:00:00 2001 From: Shohei YOSHIDA Date: Wed, 11 Dec 2024 12:33:11 +0900 Subject: [PATCH] Remove needless configurations --- src/_yfm | 67 +++++++++++++++++++++++++++++--------------------------- 1 file changed, 35 insertions(+), 32 deletions(-) diff --git a/src/_yfm b/src/_yfm index efe6265..3118ce5 100644 --- a/src/_yfm +++ b/src/_yfm @@ -42,65 +42,68 @@ _yfm_suggest_dir() { _yfm() { local context state state_descr line typeset -A opt_args + local ret=1 - local commands=( + local -a commands=( 'publish:Publish built documentation in target aws s3 compatible storage' 'translate:Translate documentation from source to target language using configured translation provider' ) - _arguments \ + _arguments -C \ '(- *)'{-h,--help}'[Show help message]' \ '(-i --input)'{-i,--input}'[Configure path to yfm input directory]:dir:_yfm_suggest_dir' \ '(-o --output)'{-o,--output}'[Configure path to yfm output directory]:dir:_yfm_suggest_dir' \ - '(--varsPreset)'--varsPreset'[Name of the variable preset used]:TEXT' \ - '(--vars -v)'{--vars,-v}'[Values of variables]:TEXT' \ - '(--strict -s)'{--strict,-s}'[Launch in strict mode]' \ - '(--quiet -q)'{--quiet,-q}'[Start in quiet mode]' \ - '(--config -c)'{--config,-c}'[Path to the configuration file]:filename:_files' \ - '(--singlePage)'--singlePage'[Build the project as a single HTML file]' \ - '(--output-format)'--output-format'[Generation format]:TEXT' \ - '(--apply-presets)'--apply-presets'[Substitute variable values from presets when building in YFM]:TEXT' \ - '(--add-system-meta)'--add-system-meta'[Add variables from the system presets section to metadata files]' \ - '(--remove-hidden-toc-items)'--remove-hidden-toc-items'[Remove hidden pages from the build result]' \ - '(--lint-disabled)'--lint-disabled'[Should whether to turn off a linter]' \ - '(--build-disabled)'--build-disabled'[Should whether to turn off a build]' \ - '(--add-map-file)'--add-map-file'[hould add all paths of documentation into file.json]' \ + '--varsPreset[Name of the variable preset used]:TEXT' \ + '(-v --vars)'{--vars,-v}'[Values of variables]:TEXT' \ + '(-s --strict)'{--strict,-s}'[Launch in strict mode]' \ + '(-q --quiet)'{--quiet,-q}'[Start in quiet mode]' \ + '(-c --config)'{--config,-c}'[Path to the configuration file]:filename:_files' \ + '--single-page[Build the project as a single HTML file]' \ + '--output-format[Generation format]:TEXT' \ + '--apply-presets[Substitute variable values from presets when building in YFM]:TEXT' \ + '--add-system-meta[Add variables from the system presets section to metadata files]' \ + '--remove-hidden-toc-items[Remove hidden pages from the build result]' \ + '--lint-disabled[Should whether to turn off a linter]' \ + '--build-disabled[Should whether to turn off a build]' \ + '--add-map-file[hould add all paths of documentation into file.json]' \ '1: :(($commands))' \ - '*:: :->command_args' + '*:: :->command_args' && ret=0 case $state in command_args) case $words[1] in publish) _arguments \ - '(--endpoint)'--endpoint'[Endpoint of S3 storage]:url:_urls' \ - '(--bucket)'--bucket'[Bucket name of S3 storage]:bucket' \ - '(--prefix)'--prefix'[Bucket internal scope of S3 storage]:bucket_internal_scope' \ - '(--access-key-id)'--access-key-id'[Key Id of S3 storage]:key_id' \ - '(--secret-access-key)'--secret-access-key'[Secret key of S3 storage]:secret_key' \ - '(--region)'--region'[Region of S3 storage]:region' \ - '(--hidden)'--hidden'[Do not upload paths matched by glob]:pattern' \ + '--endpoint[Endpoint of S3 storage]:url:_urls' \ + '--bucket[Bucket name of S3 storage]:bucket' \ + '--prefix[Bucket internal scope of S3 storage]:bucket_internal_scope' \ + '--access-key-id[Key Id of S3 storage]:key_id' \ + '--secret-access-key[Secret key of S3 storage]:secret_key' \ + '--region[Region of S3 storage]:region' \ + '--hidden[Do not upload paths matched by glob]:pattern' \ '1: :_files' \ - '*:: :->command_args' + && ret=0 ;; translate) _arguments \ - '(--source)'--source'[Language code of the original document in ISO 639-1 format]:language' \ - '(--target)'--target'[Language code of the translated document in ISO 639-1 format]:language' \ - '(--input)'--input'[Source path to the documentation]:dir:_yfm_suggest_dir' \ - '(--target)'--target'[Target path to the translated documentation]:dir:_yfm_suggest_dir' \ - '(--include)'--include'[A set of rules for filtering sent translation files]:filename:_files' \ - '(--exclude)'--exclude'[A set of rules prohibiting sending files for translation]:filename:_files' \ - '*:: :->command_args' + '--source[Language code of the original document in ISO 639-1 format]:language' \ + '--target[Language code of the translated document in ISO 639-1 format]:language' \ + '--input[Source path to the documentation]:dir:_yfm_suggest_dir' \ + '--target[Target path to the translated documentation]:dir:_yfm_suggest_dir' \ + '--include[A set of rules for filtering sent translation files]:filename:_files' \ + '--exclude[A set of rules prohibiting sending files for translation]:filename:_files' \ + && ret=0 ;; *) - _default + _default && ret=0 ;; esac ;; esac + + return ret } # Local Variables: