summary refs log tree commit diff
path: root/resources
diff options
context:
space:
mode:
authorDeepBlueV7.X <nicolas.werner@hotmail.de>2022-04-16 11:33:31 +0000
committerGitHub <noreply@github.com>2022-04-16 11:33:31 +0000
commit8cf3f1c0778c3d91dd33f086c7ab81c91bf0dff1 (patch)
treee71f99a062d49357b0fff263f90cc4e96258e921 /resources
parentFix grayscale bug AGAIN (diff)
parentadd Zsh completion (diff)
downloadnheko-8cf3f1c0778c3d91dd33f086c7ab81c91bf0dff1.tar.xz
Merge pull request #1046 from tastytea/zsh-completion
add Zsh completion
Diffstat (limited to 'resources')
-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: