mirror of
https://github.com/fish-shell/fish-shell
synced 2025-01-13 13:39:02 +00:00
Add Krita completions (#9903)
* feat(completions): support Krita * feat(completions): support summary options for Krita * feat(completions): support remaining options for Krita * feat(completions): remove debug instructions * feat(completions): hide completions for sizes for Krita * feat(completions): fix Krita * feat(changelog): mention new completion * fix(completions): refactor Krita * fix(completion): reformat * feat(completion): dynamically generate workspace list * fix(completion): refactor * fix(completion): krita * fix(completions): use printf
This commit is contained in:
parent
8d3885b9cb
commit
6ce2ffbbb0
2 changed files with 44 additions and 0 deletions
|
@ -39,6 +39,7 @@ Completions
|
|||
- ``age`` (:issue:`9813`).
|
||||
- ``age-keygen`` (:issue:`9813`).
|
||||
- ``curl`` (:issue:`9863`).
|
||||
- ``krita`` (:issue:`9903`).
|
||||
- ``blender`` (:issue:`9905`).
|
||||
- ``gimp`` (:issue:`9904`).
|
||||
|
||||
|
|
43
share/completions/krita.fish
Normal file
43
share/completions/krita.fish
Normal file
|
@ -0,0 +1,43 @@
|
|||
function __krita_complete_image_format
|
||||
set -l previous_token (commandline -oc)[-1]
|
||||
set -l current_token (commandline -t)
|
||||
|
||||
if test "$previous_token" = --new-image
|
||||
switch $current_token
|
||||
case '*,*,*'
|
||||
# nothing is completed as arbitrary width and height are expected
|
||||
case '*,'
|
||||
printf '%s,\n' U8 U16 F16 F32 |
|
||||
string replace -r '^' $current_token
|
||||
case '*'
|
||||
printf '%s,\n' RGBA XYZA LABA CMYKA GRAY YCbCrA
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function __krita_list_workspaces
|
||||
path basename ~/.local/share/krita/workspaces/*.kws |
|
||||
path change-extension ''
|
||||
end
|
||||
|
||||
complete -c krita -s h -l help -d 'show help'
|
||||
complete -c krita -l help-all -d 'show help with Qt options'
|
||||
complete -c krita -s v -l version -d 'show version'
|
||||
|
||||
complete -c krita -l export -d 'export file as image'
|
||||
complete -c krita -l export-pdf -d 'export file as PDF'
|
||||
complete -c krita -l export-sequence -d 'export animation as sequence'
|
||||
|
||||
complete -c krita -l export-filename -d 'exported filename' -n '__fish_seen_subcommand_from --export --export-pdf --export-sequence' -r
|
||||
|
||||
complete -c krita -l template -d 'open template' -r
|
||||
|
||||
complete -c krita -l nosplash -d 'hide splash screen'
|
||||
complete -c krita -l canvasonly -d 'open with canvasonly mode'
|
||||
complete -c krita -l fullscreen -d 'open with fullscreen mode'
|
||||
complete -c krita -l workspace -d 'open with workspace' -a '(__krita_list_workspaces)' -x
|
||||
complete -c krita -l file-layer -d 'open with file-layer' -r
|
||||
complete -c krita -l resource-location -d 'open with resource' -r
|
||||
|
||||
complete -c krita -l new-image -d 'open with new image'
|
||||
complete -c krita -a '(__krita_complete_image_format)' -x
|
Loading…
Reference in a new issue