aboutsummaryrefslogtreecommitdiff
path: root/2018-linuxdays/examples/zsh
diff options
context:
space:
mode:
authorKarel Kočí <cynerd@email.cz>2018-10-07 20:03:35 +0200
committerKarel Kočí <cynerd@email.cz>2018-10-07 20:03:35 +0200
commit7cf03a1555d46117b5f1a3d0db7c28c02498fcee (patch)
treee7ded2835880ad350fad3209ce667f469858cfed /2018-linuxdays/examples/zsh
parent8958b564509b4a4a63004763d70457d3ff5e5392 (diff)
downloadpresentations-7cf03a1555d46117b5f1a3d0db7c28c02498fcee.tar.gz
presentations-7cf03a1555d46117b5f1a3d0db7c28c02498fcee.tar.bz2
presentations-7cf03a1555d46117b5f1a3d0db7c28c02498fcee.zip
Add presentation from LinuxDays 2018
Diffstat (limited to '2018-linuxdays/examples/zsh')
-rw-r--r--2018-linuxdays/examples/zsh/dev4
-rw-r--r--2018-linuxdays/examples/zsh/path4
-rw-r--r--2018-linuxdays/examples/zsh/real38
-rw-r--r--2018-linuxdays/examples/zsh/simple4
-rw-r--r--2018-linuxdays/examples/zsh/switch15
5 files changed, 65 insertions, 0 deletions
diff --git a/2018-linuxdays/examples/zsh/dev b/2018-linuxdays/examples/zsh/dev
new file mode 100644
index 0000000..25de542
--- /dev/null
+++ b/2018-linuxdays/examples/zsh/dev
@@ -0,0 +1,4 @@
+_sterm() {
+ _values "tty" /dev/tty*
+}
+compdef _sterm sterm
diff --git a/2018-linuxdays/examples/zsh/path b/2018-linuxdays/examples/zsh/path
new file mode 100644
index 0000000..617d47e
--- /dev/null
+++ b/2018-linuxdays/examples/zsh/path
@@ -0,0 +1,4 @@
+_sterm() {
+ _files
+}
+compdef _sterm sterm
diff --git a/2018-linuxdays/examples/zsh/real b/2018-linuxdays/examples/zsh/real
new file mode 100644
index 0000000..7b2dce6
--- /dev/null
+++ b/2018-linuxdays/examples/zsh/real
@@ -0,0 +1,38 @@
+# vim: ft=zsh
+_sterm_baudrate() {
+ _values "Baudrate" \
+ "0" \
+ "50" \
+ "75" \
+ "110" \
+ "134" \
+ "150" \
+ "200" \
+ "300" \
+ "600" \
+ "1200" \
+ "1800" \
+ "2400" \
+ "4800" \
+ "9600" \
+ "19200" \
+ "38400" \
+ "57600" \
+ "115200" \
+ "230400"
+}
+_sterm() {
+ _arguments \
+ "--help[Output help message]" \
+ "-h[Print help text]" \
+ "-s[Set baudrate]:baudrate:_sterm_baudrate" \
+ "-b[Send break]:break:->ignore" \
+ "-c[Enter command mode]" \
+ "-d[Make pulse on DTR]:pulse:->ignore" \
+ "-r[Make pulse on RTS]:pulse:->ignore" \
+ "-e[Ignore '~.' escape sequence]" \
+ "-n[Do not switch the device to raw mode]" \
+ "-v[Verbose mode]"
+ [ "$state" = "ignore" ] || _values "tty" /dev/tty*
+}
+compdef _sterm sterm
diff --git a/2018-linuxdays/examples/zsh/simple b/2018-linuxdays/examples/zsh/simple
new file mode 100644
index 0000000..b269db3
--- /dev/null
+++ b/2018-linuxdays/examples/zsh/simple
@@ -0,0 +1,4 @@
+_sterm() {
+ _values "Baudrate" "9600" "19200" "115200"
+}
+compdef _sterm sterm
diff --git a/2018-linuxdays/examples/zsh/switch b/2018-linuxdays/examples/zsh/switch
new file mode 100644
index 0000000..09c9b29
--- /dev/null
+++ b/2018-linuxdays/examples/zsh/switch
@@ -0,0 +1,15 @@
+_sterm_baudrate() {
+ _values "Baudrate" "9600" "19200" "115200"
+}
+_sterm() {
+ _arguments \
+ "-s[Set baudrate]:baudrate:_sterm_baudrate" \
+ "-b[Send break]" \
+ "-c[Enter command mode]" \
+ "-d[Make pulse on DTR]" \
+ "-r[Make pulse on RTS]" \
+ "-e[Ignore '~.' escape sequence]" \
+ "-n[Do not switch the device to raw mode]" \
+ "-v[Verbose mode]"
+}
+compdef _sterm sterm