zsh-workers
 help / color / mirror / code / Atom feed
From: Sven Wischnowsky <wischnow@informatik.hu-berlin.de>
To: zsh-workers@sunsite.auc.dk
Subject: _call (was: Re: PATCH: _diff (new), _prcs (upgrade))
Date: Wed, 2 Feb 2000 15:21:17 +0100 (MET)	[thread overview]
Message-ID: <200002021421.PAA11232@beta.informatik.hu-berlin.de> (raw)
In-Reply-To: Alexandre Duret-Lutz's message of 28 Jan 2000 17:24:14 +0100


Alexandre Duret-Lutz wrote:

>  Sven> The only problem is that this means that such options will always be
>  Sven> combined with the ones a user might define in a style. I.e. there are
>  Sven> actually two types of options a completion function might give to a
>  Sven> command: those that *have* to be there to make it work in the way the
>  Sven> function needs it (like the -v for diff) and those the completion
>  Sven> functions *suggests* to use -- which may be overridden by a user's
>  Sven> style. Ideally, we should support both cases...
> 
> Yes, I was speaking of what you call *suggested* options.  As for now, to
> set these options, we should set a default style in compinit or elsewhere.
> But since these *suggested* options must be quite uncommon, this is not a
> problem. ok.

I was about to start writing _call when I was brought to a halt,
because, thinking again and looking at some of our functions, I'm not
so sure about the two different kinds of arguments/options any more.

Maybe we should only think about `ways to get certain informations'
instead of `parameterizing commands'. My suggestion already allowed to 
give other commands with styles but if someone really configures a
completely different command the options supplied by the calling
function may be completely senseless. So, maybe we should just make
_call get the suggested command line and let users override them
completely or leave them alone. I would then make _call take a tag as
its first argument which is used to look up the style `command'
(somehow I think this is cleaner than using a standard tag and
different style names). Maybe we should even make _call concatenate
these arguments (or the strings it gets from the style) and eval the
whole thing so that users can define pipelines to be executed. E.g.,
in _pids we would use `_call pids command ps' and
`_call display command ps' (or maybe without the `command'). In
_diff_options we would use `_call diff-version diff -v' and so on.

The only problem is that -- in cases like the _diff -- the users would 
have to know what the command has to do, but as long as we keep tags
and styles documented...

And it looks much cleaner to me than the auto-option and auto-command
magic we were discussing before.

Bye
 Sven


--
Sven Wischnowsky                         wischnow@informatik.hu-berlin.de


             reply	other threads:[~2000-02-02 14:21 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-02-02 14:21 Sven Wischnowsky [this message]
2000-02-02 16:51 ` Alexandre Duret-Lutz
2000-02-02 14:27 Sven Wischnowsky
2000-02-03  9:16 Sven Wischnowsky

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=200002021421.PAA11232@beta.informatik.hu-berlin.de \
    --to=wischnow@informatik.hu-berlin.de \
    --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).