mirror of
https://github.com/tio/tio.git
synced 2026-05-01 14:57:59 +02:00
Add shell completion of sub-configuration names
Does not work with sub configuration names that contains one or more white spaces.
This commit is contained in:
parent
bf7b032649
commit
a97b2c00cd
6 changed files with 90 additions and 30 deletions
|
|
@ -159,12 +159,14 @@ _tio()
|
|||
;;
|
||||
esac
|
||||
|
||||
sub_configs="`tio --complete-sub-configs`"
|
||||
|
||||
if [ -d /dev/serial/by-id ]; then
|
||||
ttys=$(printf '%s\n' /dev/tty* /dev/serial/by-id/*)
|
||||
else
|
||||
ttys=$(printf '%s\n' /dev/tty*)
|
||||
fi
|
||||
COMPREPLY=( $(compgen -W "${ttys}" -- ${cur}) )
|
||||
COMPREPLY=( $(compgen -W "${ttys} ${sub_configs}" -- ${cur}) )
|
||||
return 0
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue