mirror of
https://github.com/fish-shell/fish-shell
synced 2025-01-13 21:44:16 +00:00
feat(completion): support termux-camera-photo command
This commit is contained in:
parent
ca613ee7b0
commit
0dadada3a0
1 changed files with 23 additions and 0 deletions
23
share/completions/termux-camera-photo.fish
Normal file
23
share/completions/termux-camera-photo.fish
Normal file
|
@ -0,0 +1,23 @@
|
|||
function __fish_termux_api__complete_camera_ids
|
||||
set -l command termux-camera-info
|
||||
set ids ($command | jq --raw-output '.[].id')
|
||||
set types ($command | jq --raw-output '.[].facing')
|
||||
|
||||
printf "0\tdefault\n"
|
||||
|
||||
for index in (seq (count $ids))
|
||||
printf "%s\t%s\n" $ids[$index] $types[$index]
|
||||
end
|
||||
end
|
||||
|
||||
set command termux-camera-photo
|
||||
|
||||
complete -c $command \
|
||||
-s h \
|
||||
-d 'Show [h]elp'
|
||||
|
||||
complete -c $command \
|
||||
-a '(__fish_termux_api__complete_camera_ids)' \
|
||||
-s c \
|
||||
-d 'Specify a [c]amera ID' \
|
||||
-x
|
Loading…
Reference in a new issue