mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-11-22 03:00:46 +03:00
add Zsh completion
Installs into the default site-wide Zsh directory.
This commit is contained in:
parent
f688e15379
commit
9d15bfae99
2 changed files with 24 additions and 0 deletions
|
@ -743,6 +743,7 @@ if(UNIX AND NOT APPLE)
|
|||
install (FILES "resources/nheko.svg" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/scalable/apps" RENAME "nheko.svg")
|
||||
install (FILES "resources/nheko.desktop" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/applications")
|
||||
install (FILES "resources/nheko.appdata.xml" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/metainfo")
|
||||
install (FILES "resources/_nheko" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/zsh/site-functions")
|
||||
|
||||
if(NOT TARGET uninstall)
|
||||
configure_file(
|
||||
|
|
23
resources/_nheko
Normal file
23
resources/_nheko
Normal file
|
@ -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:
|
Loading…
Reference in a new issue