Enhance backtunnel-share with improved desktop integration, port collision checks, and pre-flight validations

This commit is contained in:
2025-09-14 14:11:36 +02:00
parent 07dbd79aa2
commit b1dd9bfc83
6 changed files with 61 additions and 3 deletions

View File

@@ -32,6 +32,20 @@ _backtunnel_complete() {
return 0
fi
# backtunnel-share: after positionals, propose flags incl. invite
if [[ ${COMP_WORDS[0]} == backtunnel-share && ${COMP_CWORD} -ge 5 ]]; then
local opts="-p --tunnel-port -l --local-ssh-port -i --invite --invite-mount --invite-file --qr -h --help"
mapfile -t COMPREPLY < <(compgen -W "${opts}" -- "${cur}")
return 0
fi
# backtunnel-access: after positionals, propose its flags
if [[ ${COMP_WORDS[0]} == backtunnel-access && ${COMP_CWORD} -ge 3 ]]; then
local opts="-p --port -m --mount-point -h --help"
mapfile -t COMPREPLY < <(compgen -W "${opts}" -- "${cur}")
return 0
fi
COMPREPLY=()
}