From 9c0dcfe621b9038dbdb56bcda1db4afb84a1bb84 Mon Sep 17 00:00:00 2001 From: arcan1s Date: Fri, 18 Jul 2014 00:05:10 +0400 Subject: [PATCH] small update --- sources/gui/CMakeLists.txt | 2 +- sources/gui/bash-completions | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/sources/gui/CMakeLists.txt b/sources/gui/CMakeLists.txt index 47bafab..3d7a689 100644 --- a/sources/gui/CMakeLists.txt +++ b/sources/gui/CMakeLists.txt @@ -23,4 +23,4 @@ configure_file (${SUBPROJECT_MAN_IN} ${CMAKE_CURRENT_BINARY_DIR}/${SUBPROJECT_MA install (FILES ${SUBPROJECT}.desktop DESTINATION share/applications/) install (FILES ${CMAKE_CURRENT_BINARY_DIR}/${SUBPROJECT_MAN} DESTINATION share/man/man1/) install (FILES bash-completions DESTINATION share/bash-completion/completions/ RENAME _${SUBPROJECT}) -install (FILES zsh-completions DESTINATION share/zsh/site-functions/ RENAME _${SUBPROJECT}) +install (FILES zsh-completions DESTINATION share/zsh/site-functions/ RENAME ${SUBPROJECT}) diff --git a/sources/gui/bash-completions b/sources/gui/bash-completions index 8a4f2ae..f50ccd2 100644 --- a/sources/gui/bash-completions +++ b/sources/gui/bash-completions @@ -68,7 +68,9 @@ _netctl_gui_tabs=( '3' ) -_netctl_profiles=($(find /etc/netctl -maxdepth 1 -type f -printf "%f\n")) +_netctl_profiles() { + echo $(find /etc/netctl -maxdepth 1 -type f -printf "%f\n") +} # work block @@ -79,12 +81,12 @@ _netctl_gui() { wantsettings='-@(-set-opts)' wantstring='-@(e|-essid)' wanttabs='-@(t|-tab)' - _get_comp_words_by_ref cur prev + _get_comp_words_by_ref cur prev words cword if [[ $prev = $wantfiles ]]; then _filedir elif [[ $prev = $wantprofiles ]]; then - COMPREPLY=($(compgen -W '${_netctl_profiles[@]}' -- "$cur")) + COMPREPLY=($(compgen -W '$(_netctl_profiles)' -- "$cur")) elif [[ $prev = $wantsettings ]]; then COMPREPLY=($(compgen -S ',' -W '${_netctl_gui_settings[@]}' -- "$cur")) elif [[ $prev = $wantstring ]]; then