From 4e50ed4edbd4f29bd8465ec12b4b2742135aa202 Mon Sep 17 00:00:00 2001 From: EmilyGraceSeville7cf Date: Wed, 2 Oct 2024 08:16:09 +1000 Subject: [PATCH] feat(completion): support kroki command --- share/completions/kroki.fish | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 share/completions/kroki.fish diff --git a/share/completions/kroki.fish b/share/completions/kroki.fish new file mode 100644 index 000000000..fc6ad78e4 --- /dev/null +++ b/share/completions/kroki.fish @@ -0,0 +1,36 @@ +set -l command kroki + +complete -c $command -f + +complete -c $command -s h -l help -d 'Show help' +complete -c $command -s v -l version -d 'Show version' + +set -l subcommands_with_descriptions 'help\t"Select multiple values using checkboxes"' \ + 'version\t"Pick a number in specific range"' \ + 'convert\t"Show a confirmation"' + +set -l subcommands (string replace --regex '\\\t.+' '' -- $subcommands_with_descriptions) + +complete -c $command -a "$subcommands_with_descriptions" \ + -n "not __fish_seen_subcommand_from $subcommands" + +set -l convert_condition '__fish_seen_subcommand_from convert' + +complete -c $command -s c -l config -r \ + -d 'Specify the configuration file for a diagram' \ + -n $convert_condition + +complete -c $command -s f -l format -x \ + -a 'svg jpg png pdf' \ + -d 'Specify the output file format for a diagram' \ + -n $convert_condition + +complete -c $command -s o -l out-file -r \ + -d 'Specify the output file for a diagram' \ + -n $convert_condition + +complete -c $command -s t -l type -x \ + -a 'actdiag blockdiag c4plantuml ditaa dot erd graphviz nomnoml nwdiag +plantuml seqdiag svgbob symbolator umlet vega vegalite' \ + -d 'Specify the type of a diagram' \ + -n $convert_condition