From 9fad7e9936216357ebc6285c27c54cf34a5e0fca Mon Sep 17 00:00:00 2001 From: EmilyGraceSeville7cf Date: Tue, 17 Sep 2024 02:03:22 +1000 Subject: [PATCH] fix(completion): use new function to complete streams --- share/completions/termux-tts-speak.fish | 2 +- share/functions/__fish_termux_api__complete_stream_ids.fish | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 share/functions/__fish_termux_api__complete_stream_ids.fish diff --git a/share/completions/termux-tts-speak.fish b/share/completions/termux-tts-speak.fish index 54f30132e..1c4e987ef 100644 --- a/share/completions/termux-tts-speak.fish +++ b/share/completions/termux-tts-speak.fish @@ -38,7 +38,7 @@ complete -c $command \ -x complete -c $command \ - -a 'notification\tdefault alarm music ring system voice_call' \ + -a '(__fish_termux_api__complete_stream_ids | string replace --regex "(notification)" "\$1\tdefault")' \ -s s \ -d 'Specify the [s]tream for a speech' \ -x diff --git a/share/functions/__fish_termux_api__complete_stream_ids.fish b/share/functions/__fish_termux_api__complete_stream_ids.fish new file mode 100644 index 000000000..cf10c36ce --- /dev/null +++ b/share/functions/__fish_termux_api__complete_stream_ids.fish @@ -0,0 +1,3 @@ +function __fish_termux_api__complete_stream_ids + string join \n -- notification alarm music ring system voice_call +end