Skip to content

Commit ee6494e

Browse files
committed
#3 Support Fish shell
1 parent 51d8edf commit ee6494e

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

completion/fish.sh

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Define subcommands list
2+
set -l commands list status connect disconnect quit
3+
4+
# Disable filesystem completions
5+
complete -c tunblkctl --no-files
6+
7+
# Complete commands
8+
complete -c tunblkctl --condition "not __fish_seen_subcommand_from $commands" \
9+
-a "$commands"
10+
11+
# Complete VPN names
12+
complete -c tunblkctl --condition "__fish_seen_subcommand_from connect disconnect" \
13+
-a "(tunblkctl list)"
14+
15+
# Complete strip option
16+
complete -c tunblkctl --condition "__fish_seen_subcommand_from status" \
17+
-l strip -d 'Strip output formatting (raw mode)'
18+
19+
# Complete no-strip option
20+
complete -c tunblkctl --condition "__fish_seen_subcommand_from status" \
21+
-l no-strip -d 'Do not strip output formatting (human mode)'

0 commit comments

Comments
 (0)