From 0dadada3a0ebbc4c50f5b54539ab5b06cba83431 Mon Sep 17 00:00:00 2001 From: EmilyGraceSeville7cf Date: Sun, 15 Sep 2024 08:07:46 +1000 Subject: [PATCH] feat(completion): support termux-camera-photo command --- share/completions/termux-camera-photo.fish | 23 ++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 share/completions/termux-camera-photo.fish diff --git a/share/completions/termux-camera-photo.fish b/share/completions/termux-camera-photo.fish new file mode 100644 index 000000000..3e5e1f634 --- /dev/null +++ b/share/completions/termux-camera-photo.fish @@ -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