From 815a24e2de9764022943d24fa81621c185cbab90 Mon Sep 17 00:00:00 2001 From: Tim Harder Date: Fri, 21 Nov 2014 09:02:24 -0500 Subject: move completions into src subdir --- src/_gcc-config | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 src/_gcc-config (limited to 'src/_gcc-config') diff --git a/src/_gcc-config b/src/_gcc-config new file mode 100644 index 0000000..3b0fcf3 --- /dev/null +++ b/src/_gcc-config @@ -0,0 +1,27 @@ +#compdef gcc-config +#Author oberyno + +local arguments + +arguments=( + '(- :)'{--use-old,-O}'[use the old profile if one was selected]' + '(- :)'{--use-portage-chost,-P}'[only set profile if its CHOST matches /etc/{portage/}make.conf]:profiles:_gcc_profile' + '(- :)'{--get-current-profile,-c}'[print current used gcc profile]' + '(- :)'{--list-profiles,-l}'[print a list of available profiles]' + '(- :)'{--print-environ,-E}'[print environment of the given/current profile]:profiles:_gcc_profile' + '(- :)'{--get-bin-path,-B}'[print binary path of given/current profile]:profiles:_gcc_profile' + '(- :)'{--get-lib-path,-L}'[print library path of given/current profile]:profiles:_gcc_profile' + '(- :)'{--get-stdcxx-incdir,-X}'[print g++ include path of given/current profile]:profiles:_gcc_profile' + '(- :)'{--help,-h}'[show help]' + '(- :)'{--version,-v}'[show version info]' + '(- :):profiles:_gcc_profile' +) + +_gcc_profile(){ + local profile + profile=(${(f)"$(_call_program gcc-installed RC_NOCOLOR=yes gcc-config --list-profiles)"}) + profile=${${profile/\[([^]]*)\]/}/\*} + _tags profile && { compadd "$@" -k profile || compadd "$@" ${(kv)=profile} } +} + +_arguments $arguments -- cgit v1.2.3-65-gdbad