Add -m command to README and completion files

This commit is contained in:
Danilo Bargen 2020-01-22 22:52:44 +01:00
commit 95fab99e82
4 changed files with 7 additions and 3 deletions

View file

@ -71,6 +71,7 @@ These are the clients I tried but failed to compile or run:
-u --update Update the local cache
-c --clear-cache Clear the local cache
-p --pager Use a pager to page output
-m --markdown Display the raw markdown instead of rendering it
-q --quiet Suppress informational messages
--config-path Show config file path
--seed-config Create a basic config

View file

@ -6,7 +6,7 @@ _tealdeer()
_init_completion || return
case $prev in
-h|--help|-v|--version|-l|--list|-u|--update|-c|--clear-cache|--config-path|--seed-config|-q|--quiet)
-h|--help|-v|--version|-l|--list|-u|--update|-c|--clear-cache|-p|--pager|-m|--markdown|--config-path|--seed-config|-q|--quiet)
return
;;
-f|--render)

View file

@ -10,6 +10,8 @@ complete -c tldr -s f -l render -d 'Render a specific markdown file.' -r
complete -c tldr -s o -l os -d 'Override the operating system.' -xa 'linux osx sunos windows other'
complete -c tldr -s u -l update -d 'Update the local cache.' -f
complete -c tldr -s c -l clear-cache -d 'Clear the local cache.' -f
complete -c tldr -s p -l pager -d 'Use a pager to page output.' -f
complete -c tldr -s m -l markdown -d 'Display the raw markdown instead of rendering it.' -f
complete -c tldr -s q -l quiet -d 'Suppress informational messages.' -f
complete -c tldr -l config-path -d 'Show config file path.' -f
complete -c tldr -l seed-config -d 'Create a basic config.' -f

View file

@ -8,7 +8,7 @@ _tealdeer() {
local I="-h --help -v --version"
integer ret=1
local -a args
args+=(
"($I -l --list)"{-l,--list}"[List all commands in the cache]"
"($I -f --render)"{-f,--render}"[Render a specific markdown file]:file:_files"
@ -21,6 +21,7 @@ _tealdeer() {
"($I -u --update)"{-u,--update}"[Update the local cache]"
"($I -c --clear-cache)"{-c,--clear-cache}"[Clear the local cache]"
"($I -p --pager)"{-p,--pager}"[Use a pager to page output]"
"($I -m --markdown)"{-m,--markdown}"[Display the raw markdown instead of rendering it]"
"($I -q --quiet)"{-q,--quiet}"[Suppress informational messages]"
"($I)--config-path[Show config file path]"
"($I)--seed-config[Create a basic config]"
@ -29,7 +30,7 @@ _tealdeer() {
'*:file:_files'
'1: :_applications'
)
_arguments $args[@] && ret=0
return ret
}