mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-26 21:03:12 +00:00
feat(completion): specify default output type for mmdc
This commit is contained in:
parent
06dde596f2
commit
e22d901875
3 changed files with 17 additions and 13 deletions
|
@ -19,7 +19,7 @@ complete -c $command -s h -l height -x \
|
|||
|
||||
complete -c $command -s i -l input -r -d 'Specify the input file of a chart'
|
||||
complete -c $command -s o -l output -r \
|
||||
-a '(__fish_print_extensions svg md png pdf)' \
|
||||
-a '(__fish_complete_extensions svg\tdefault md png pdf)' \
|
||||
-d 'Specify the output file of a chart'
|
||||
|
||||
complete -c $command -s e -l outputFormat -x \
|
||||
|
|
16
share/functions/__fish_complete_extensions.fish
Normal file
16
share/functions/__fish_complete_extensions.fish
Normal file
|
@ -0,0 +1,16 @@
|
|||
function __fish_complete_extensions \
|
||||
--description 'Suggest provided extensions as $argv if the current token ends with a dot'
|
||||
|
||||
set token (commandline -c -t)
|
||||
|
||||
switch "$token"
|
||||
case '*.'
|
||||
for extension in $argv
|
||||
if string match --quiet --regex '\\\t|\t' -- $extension
|
||||
echo -e "$token$extension"
|
||||
else
|
||||
printf "%s%s\n" $token $extension
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
|
@ -1,12 +0,0 @@
|
|||
function __fish_print_extensions \
|
||||
--description 'Suggest provided extensions as $argv if the current token ends with a dot'
|
||||
|
||||
set token (commandline -c -t)
|
||||
|
||||
switch "$token"
|
||||
case '*.'
|
||||
for extension in $argv
|
||||
printf "%s%s\n" $token $extension
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Reference in a new issue