Skip to content
This repository has been archived by the owner on Oct 30, 2019. It is now read-only.

hassbian-config: Fixes tab-autocomplete. #93

Merged
merged 2 commits into from
Feb 7, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 2 additions & 7 deletions package/etc/bash_completion.d/hassbian-config
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,11 @@ _hassbian-config()
opts="install upgrade show log share-log"

case "${prev}" in
install)
local inst=$(find /opt/hassbian/suites/ -maxdepth 1 -type f -name 'install_*' | grep -v 'install_homeassistant.sh' | awk -F'/|_' ' {print $NF}' | awk -F. '{print $1}')
install|upgrade)
local inst=$(find /opt/hassbian/suites/ -maxdepth 1 -type f | awk -F'/|_' ' {print $NF}' | awk -F. '{print $1}')
COMPREPLY=( $(compgen -W "${inst}" -- ${cur}) )
return 0
;;
upgrade)
local upd=$(find /opt/hassbian/suites/ -maxdepth 1 -type f -name 'upgrade*' | awk -F'/|_' ' {print $NF}' | awk -F. '{print $1}')
COMPREPLY=( $(compgen -W "${upd}" -- ${cur}) )
return 0
;;
*)
;;
esac
Expand Down