fork/fish-shell

git clone https://git.julia.blue/fork/fish-shell

Johannes AltmanningerMerge branch 'completions-to-use-expanded-tokens'a9618477e

master
1.7 KiB43 linesraw
1function __krita_complete_image_format
2    set -l previous_token (commandline -xc)[-1]
3    set -l current_token (commandline -t)
4
5    if test "$previous_token" = --new-image
6        switch $current_token
7            case '*,*,*'
8                # nothing is completed as arbitrary width and height are expected
9            case '*,'
10                printf '%s,\n' U8 U16 F16 F32 |
11                    string replace -r '^' $current_token
12            case '*'
13                printf '%s,\n' RGBA XYZA LABA CMYKA GRAY YCbCrA
14        end
15    end
16end
17
18function __krita_list_workspaces
19    path basename ~/.local/share/krita/workspaces/*.kws |
20        path change-extension ''
21end
22
23complete -c krita -s h -l help -d 'show help'
24complete -c krita -l help-all -d 'show help with Qt options'
25complete -c krita -s v -l version -d 'show version'
26
27complete -c krita -l export -d 'export file as image'
28complete -c krita -l export-pdf -d 'export file as PDF'
29complete -c krita -l export-sequence -d 'export animation as sequence'
30
31complete -c krita -l export-filename -d 'exported filename' -n '__fish_seen_subcommand_from --export --export-pdf --export-sequence' -r
32
33complete -c krita -l template -d 'open template' -r
34
35complete -c krita -l nosplash -d 'hide splash screen'
36complete -c krita -l canvasonly -d 'open with canvasonly mode'
37complete -c krita -l fullscreen -d 'open with fullscreen mode'
38complete -c krita -l workspace -d 'open with workspace' -a '(__krita_list_workspaces)' -x
39complete -c krita -l file-layer -d 'open with file-layer' -r
40complete -c krita -l resource-location -d 'open with resource' -r
41
42complete -c krita -l new-image -d 'open with new image'
43complete -c krita -a '(__krita_complete_image_format)' -x