From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 888 invoked from network); 8 Feb 1999 19:48:54 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 8 Feb 1999 19:48:54 -0000 Received: (qmail 5134 invoked by alias); 8 Feb 1999 19:47:18 -0000 Mailing-List: contact zsh-users-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 2121 Received: (qmail 5118 invoked from network); 8 Feb 1999 19:47:17 -0000 Date: Mon, 8 Feb 1999 14:46:23 -0500 From: Sweth Chandramouli To: zsh-users@sunsite.auc.dk Subject: Re: setopt and alias questions Message-ID: <19990208144623.B4151@astaroth.nit.gwu.edu> Mail-Followup-To: zsh-users@sunsite.auc.dk References: <19990207193735.A2060@astaroth.nit.gwu.edu> <990207175931.ZM8940@candle.brasslantern.com> <19990207235214.A2653@astaroth.nit.gwu.edu> <990207233343.ZM10079@candle.brasslantern.com> <19990208103038.A3447@astaroth.nit.gwu.edu> <990208104550.ZM14297@candle.brasslantern.com> <19990208141534.A4151@astaroth.nit.gwu.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.95i In-Reply-To: <19990208141534.A4151@astaroth.nit.gwu.edu> for those who are interested, here's the final version of my allopt function, which now can take arguments at the command line to use as patterns for selecting which options to display, and which uses bart's much nicer way of swapping the on/off settings (or at least, the pre-3.1.5-pws-5 version of bart's way): allopt () { listalloptions () { builtin setopt localoptions kshoptionprint for OPT_PAIR in "${(f)$(builtin setopt)}" ; do OPT_VALUE=${OPT_PAIR##* } OPT_NAME=${OPT_PAIR%% *} if [[ ${OPT_NAME#no} != ${OPT_NAME} ]] ; then OPT_VALUE=${(L)${${OPT_VALUE:s/on/OFF}:s/off/on}} && OPT_NAME=${OPT_NAME#no}; fi; echo ${(r:21:)OPT_NAME} ${OPT_VALUE} done }; if [[ -n $@ ]] ; then listalloptions | egrep "${@:s/ /|/}" else listalloptions fi; } and here's a quick completion hack, inside of an anonymous code block so that localoptions will work: { builtin setopt localoptions kshoptionprint optlist=("${${(f)$(builtin setopt)}%% *}") compctl -k optlist setopt allopt } -- sweth. -- Sweth Chandramouli IS Coordinator, The George Washington University / (202) 994 - 8521 (V) / (202) 994 - 0458 (F) *