Remove needless configurations
This commit is contained in:
parent
e7068f9923
commit
1ae4ab5dc2
67
src/_yfm
67
src/_yfm
|
@ -42,65 +42,68 @@ _yfm_suggest_dir() {
|
||||||
_yfm() {
|
_yfm() {
|
||||||
local context state state_descr line
|
local context state state_descr line
|
||||||
typeset -A opt_args
|
typeset -A opt_args
|
||||||
|
local ret=1
|
||||||
|
|
||||||
local commands=(
|
local -a commands=(
|
||||||
'publish:Publish built documentation in target aws s3 compatible storage'
|
'publish:Publish built documentation in target aws s3 compatible storage'
|
||||||
'translate:Translate documentation from source to target language using configured translation provider'
|
'translate:Translate documentation from source to target language using configured translation provider'
|
||||||
)
|
)
|
||||||
|
|
||||||
_arguments \
|
_arguments -C \
|
||||||
'(- *)'{-h,--help}'[Show help message]' \
|
'(- *)'{-h,--help}'[Show help message]' \
|
||||||
'(-i --input)'{-i,--input}'[Configure path to yfm input directory]:dir:_yfm_suggest_dir' \
|
'(-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' \
|
'(-o --output)'{-o,--output}'[Configure path to yfm output directory]:dir:_yfm_suggest_dir' \
|
||||||
'(--varsPreset)'--varsPreset'[Name of the variable preset used]:TEXT' \
|
'--varsPreset[Name of the variable preset used]:TEXT' \
|
||||||
'(--vars -v)'{--vars,-v}'[Values of variables]:TEXT' \
|
'(-v --vars)'{--vars,-v}'[Values of variables]:TEXT' \
|
||||||
'(--strict -s)'{--strict,-s}'[Launch in strict mode]' \
|
'(-s --strict)'{--strict,-s}'[Launch in strict mode]' \
|
||||||
'(--quiet -q)'{--quiet,-q}'[Start in quiet mode]' \
|
'(-q --quiet)'{--quiet,-q}'[Start in quiet mode]' \
|
||||||
'(--config -c)'{--config,-c}'[Path to the configuration file]:filename:_files' \
|
'(-c --config)'{--config,-c}'[Path to the configuration file]:filename:_files' \
|
||||||
'(--singlePage)'--singlePage'[Build the project as a single HTML file]' \
|
'--single-page[Build the project as a single HTML file]' \
|
||||||
'(--output-format)'--output-format'[Generation format]:TEXT' \
|
'--output-format[Generation format]:TEXT' \
|
||||||
'(--apply-presets)'--apply-presets'[Substitute variable values from presets when building in YFM]:TEXT' \
|
'--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]' \
|
'--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]' \
|
'--remove-hidden-toc-items[Remove hidden pages from the build result]' \
|
||||||
'(--lint-disabled)'--lint-disabled'[Should whether to turn off a linter]' \
|
'--lint-disabled[Should whether to turn off a linter]' \
|
||||||
'(--build-disabled)'--build-disabled'[Should whether to turn off a build]' \
|
'--build-disabled[Should whether to turn off a build]' \
|
||||||
'(--add-map-file)'--add-map-file'[hould add all paths of documentation into file.json]' \
|
'--add-map-file[hould add all paths of documentation into file.json]' \
|
||||||
'1: :(($commands))' \
|
'1: :(($commands))' \
|
||||||
'*:: :->command_args'
|
'*:: :->command_args' && ret=0
|
||||||
|
|
||||||
case $state in
|
case $state in
|
||||||
command_args)
|
command_args)
|
||||||
case $words[1] in
|
case $words[1] in
|
||||||
publish)
|
publish)
|
||||||
_arguments \
|
_arguments \
|
||||||
'(--endpoint)'--endpoint'[Endpoint of S3 storage]:url:_urls' \
|
'--endpoint[Endpoint of S3 storage]:url:_urls' \
|
||||||
'(--bucket)'--bucket'[Bucket name of S3 storage]:bucket' \
|
'--bucket[Bucket name of S3 storage]:bucket' \
|
||||||
'(--prefix)'--prefix'[Bucket internal scope of S3 storage]:bucket_internal_scope' \
|
'--prefix[Bucket internal scope of S3 storage]:bucket_internal_scope' \
|
||||||
'(--access-key-id)'--access-key-id'[Key Id of S3 storage]: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' \
|
'--secret-access-key[Secret key of S3 storage]:secret_key' \
|
||||||
'(--region)'--region'[Region of S3 storage]:region' \
|
'--region[Region of S3 storage]:region' \
|
||||||
'(--hidden)'--hidden'[Do not upload paths matched by glob]:pattern' \
|
'--hidden[Do not upload paths matched by glob]:pattern' \
|
||||||
'1: :_files' \
|
'1: :_files' \
|
||||||
'*:: :->command_args'
|
&& ret=0
|
||||||
;;
|
;;
|
||||||
|
|
||||||
translate)
|
translate)
|
||||||
_arguments \
|
_arguments \
|
||||||
'(--source)'--source'[Language code of the original document in ISO 639-1 format]:language' \
|
'--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' \
|
'--target[Language code of the translated document in ISO 639-1 format]:language' \
|
||||||
'(--input)'--input'[Source path to the documentation]:dir:_yfm_suggest_dir' \
|
'--input[Source path to the documentation]:dir:_yfm_suggest_dir' \
|
||||||
'(--target)'--target'[Target path to the translated documentation]:dir:_yfm_suggest_dir' \
|
'--target[Target path to the translated documentation]:dir:_yfm_suggest_dir' \
|
||||||
'(--include)'--include'[A set of rules for filtering sent translation files]:filename:_files' \
|
'--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' \
|
'--exclude[A set of rules prohibiting sending files for translation]:filename:_files' \
|
||||||
'*:: :->command_args'
|
&& ret=0
|
||||||
;;
|
;;
|
||||||
|
|
||||||
*)
|
*)
|
||||||
_default
|
_default && ret=0
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
return ret
|
||||||
}
|
}
|
||||||
|
|
||||||
# Local Variables:
|
# Local Variables:
|
||||||
|
|
Loading…
Reference in New Issue