summary refs log tree commit diff
path: root/resources/_nheko
diff options
context:
space:
mode:
authortastytea <tastytea@tastytea.de>2022-04-16 10:50:12 +0200
committertastytea <tastytea@tastytea.de>2022-04-16 10:55:36 +0200
commit9d15bfae99f50e40e9410f8e8e58c5bd5549c1a7 (patch)
tree413f5ee0771fc06b697ed8ecbb8b57c1237a8c79 /resources/_nheko
parentFix cursor not being closed before txn was committed (diff)
downloadnheko-9d15bfae99f50e40e9410f8e8e58c5bd5549c1a7.tar.xz
add Zsh completion
Installs into the default site-wide Zsh directory.
Diffstat (limited to 'resources/_nheko')
-rw-r--r--resources/_nheko23
1 files changed, 23 insertions, 0 deletions
diff --git a/resources/_nheko b/resources/_nheko
new file mode 100644
index 00000000..c730b2b3
--- /dev/null
+++ b/resources/_nheko
@@ -0,0 +1,23 @@
+#compdef nheko
+
+_arguments '--help[Displays help on commandline options.]' \
+           '-h[Displays help on commandline options.]' \
+           '--help-all[Displays help including Qt specific options.]' \
+           '--version[Displays version information.]' \
+           '-v[Displays version information.]' \
+           '--debug[Enables debug output.]' \
+           '--profile[Create or select profile.]:profile:_nheko_select_profile' \
+           '-p[Create or select profile.]:profile:_nheko_select_profile'
+
+function _nheko_select_profile()
+{
+    local -a profiles=(default)
+    while read -r line; do
+        [[ ${line} =~ '\\auth\\device_id' ]] && profiles+=(${line%%\\*})
+    done < ${XDG_CONFIG_HOME:-~/.config}/nheko/nheko.conf
+    _values "profile" ${profiles}
+}
+
+# Local Variables:
+# mode: shell-script
+# End: