From 7cf03a1555d46117b5f1a3d0db7c28c02498fcee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Sun, 7 Oct 2018 20:03:35 +0200 Subject: Add presentation from LinuxDays 2018 --- 2018-linuxdays/examples/bash/switch | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 2018-linuxdays/examples/bash/switch (limited to '2018-linuxdays/examples/bash/switch') diff --git a/2018-linuxdays/examples/bash/switch b/2018-linuxdays/examples/bash/switch new file mode 100644 index 0000000..db55dd7 --- /dev/null +++ b/2018-linuxdays/examples/bash/switch @@ -0,0 +1,16 @@ +_sterm() { + local cur prev words cword + _init_completion || return + case "$prev" in + -b|-d|-r) + # No completion for these + ;; + -s) + COMPREPLY=($(compgen -W "9600 19200 38400 57600 115200" -- ${cur})) + ;; + *) + COMPREPLY=($(compgen -W "-s -b -d -r" -- ${cur})) + ;; + esac +} +complete -o default -F _sterm sterm -- cgit v1.2.3