Remove needless configurations

This commit is contained in:
Shohei YOSHIDA 2024-12-11 12:33:11 +09:00
parent e7068f9923
commit 1ae4ab5dc2
No known key found for this signature in database
GPG Key ID: C9A1BB11BB940CF2
1 changed files with 35 additions and 32 deletions

View File

@ -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: