From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16563 invoked from network); 21 Jul 2000 22:22:50 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 21 Jul 2000 22:22:50 -0000 Received: (qmail 23243 invoked by alias); 21 Jul 2000 22:22:41 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 12344 Received: (qmail 23236 invoked from network); 21 Jul 2000 22:22:38 -0000 From: "Bart Schaefer" Message-Id: <000721152233.ZM3870@candle.brasslantern.com> Date: Fri, 21 Jul 2000 15:22:33 -0700 X-Mailer: Z-Mail Lite (5.0.0 30July97) To: zsh-workers@sunsite.auc.dk Subject: _arguments parsing of --help output MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Many GNU commands include short options in the --help output as well as long ones; e.g. `tar --help' emits lines like "-m, --modifcation-time ...". The code in _arguments accounts for this by splitting the line at commas, but then discards the short form of the option. Is there a reason that we don't attempt to complete the short forms as well? I'm also curious in what circumstances the code to "... split the result again at newlines after joining the old array elements with newlines between them" ever makes a difference? It strikes me as redundant. More succinctly, what's wrong with the following reformulation of the lopts assignment at lines 70-72 of _arguments? lopts=("-${(@)^${(@)${(@)${(@M)${(@)${(@M)${(@f)$(_call options ${~words[1]} --help 2>&1)//\[--/ --}:#[ ]#-*}//,/ }:#[ ]#-*}#*-}%%[] ]*}:#}")