zsh-users
 help / color / mirror / code / Atom feed
From: Eric Mangold <teratorn@world-net.net>
To: zsh-users@sunsite.dk
Subject: short option and long option completion formatting
Date: Thu, 12 Feb 2004 14:56:55 -0700	[thread overview]
Message-ID: <opr291w5p9i4eeqj@mail.oaktech.net> (raw)

Hello folks,

I'm writing completion functions and I've come across a formatting issue.

The commands I'm doing completions for have a number of short options and 
matching long options (such as -p and --port).  The way I'm doing it now, 
using _arguments, is to have a seperate spec for the short options and the 
corresponding long options. These specs are, of course, virtually 
identical and when _arguments formats the output on screen they show up on 
seperate lines, such as:

--bar -- Description of bar
--baz -- Description of baz
--foo -- Description of foo
-a    -- Description of A
-b    -- Description of bar
-f    -- Description of foo

I want a way to combine these specs so as not to duplicate "code" and a 
way to format this all on one line, such as:

-a        -- A description
-b, --bar -- Description of bar
-f, --foo -- Description of foo
      --baz -- baz description

I find this formatting quite a bit more readable especially as the number 
of options increases. I've done some searching on the ML archives and 
poking around the official completion functions and havn't found anything 
related. I'm really new to writing completions and looking for help.

Any ideas on how to implement this?

Thank you,
-Eric Mangold

-PS By the way, the commands I'm doing completion for are twistd and mktap 
of the Twisted project. use their --help options to see how that gets 
formatted (very close to what I want the completion to look like). Or if 
anyone is curious about how it looks and doesn't want to install Twisted I 
shall respond with that info.


             reply	other threads:[~2004-02-12 23:02 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-02-12 21:56 Eric Mangold [this message]
  -- strict thread matches above, loose matches on Subject: below --
2004-02-12 22:17 Eric Mangold
2004-02-13 23:51 ` Eric Mangold
2004-02-12  5:58 Eric Mangold
2004-02-12 17:46 ` 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=opr291w5p9i4eeqj@mail.oaktech.net \
    --to=teratorn@world-net.net \
    --cc=zsh-users@sunsite.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).