Skip to content

Commit

Permalink
#3 Support Fish shell
Browse files Browse the repository at this point in the history
  • Loading branch information
azhuchkov committed Apr 30, 2024
1 parent 51d8edf commit ee6494e
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions completion/fish.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Define subcommands list
set -l commands list status connect disconnect quit

# Disable filesystem completions
complete -c tunblkctl --no-files

# Complete commands
complete -c tunblkctl --condition "not __fish_seen_subcommand_from $commands" \
-a "$commands"

# Complete VPN names
complete -c tunblkctl --condition "__fish_seen_subcommand_from connect disconnect" \
-a "(tunblkctl list)"

# Complete strip option
complete -c tunblkctl --condition "__fish_seen_subcommand_from status" \
-l strip -d 'Strip output formatting (raw mode)'

# Complete no-strip option
complete -c tunblkctl --condition "__fish_seen_subcommand_from status" \
-l no-strip -d 'Do not strip output formatting (human mode)'

0 comments on commit ee6494e

Please sign in to comment.