head	1.2;
access;
symbols;
locks; strict;
comment	@# @;


1.2
date	2005.02.22.14.08.13;	author usata;	state Exp;
branches;
next	1.1;

1.1
date	2005.02.22.13.49.23;	author usata;	state Exp;
branches;
next	;


desc
@@


1.2
log
@Patch submitted by baptux <bapt@@ifrance.com> to make the completion work correctly. See bug #71957.
@
text
@#compdef gcc-config
#Author oberyno <oberyno@@gmail.com>

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/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 gcc-config --list-profiles)"})
    profile=${${profile/\[([^]]*)\]/}/\*}
    _tags profile && { compadd "$@@" -k profile || compadd "$@@" ${(kv)=profile} }
}

_arguments $arguments
@


1.1
log
@Initial revision
@
text
@d22 2
a23 2
    profile=$(_call_program tag gcc-config --list-profiles)
    profile=${profile/\[([^]]*)\]/}
@
