zsh-workers
 help / color / mirror / code / Atom feed
From: "Bart Schaefer" <schaefer@candle.brasslantern.com>
To: zsh-workers@sunsite.auc.dk
Subject: _arguments parsing of --help output
Date: Fri, 21 Jul 2000 15:22:33 -0700	[thread overview]
Message-ID: <000721152233.ZM3870@candle.brasslantern.com> (raw)

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)//\[--/
--}:#[ 	]#-*}//,/
}:#[ 	]#-*}#*-}%%[]	 ]*}:#}")


             reply	other threads:[~2000-07-21 22:22 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-07-21 22:22 Bart Schaefer [this message]
2000-07-21 23:10 ` Bart Schaefer
2000-07-24  8:52 Sven Wischnowsky
2000-07-25 15:05 ` Bart Schaefer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=000721152233.ZM3870@candle.brasslantern.com \
    --to=schaefer@candle.brasslantern.com \
    --cc=zsh-workers@sunsite.auc.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).