From: Sven Wischnowsky <wischnow@informatik.hu-berlin.de>
To: zsh-workers@sunsite.auc.dk
Subject: PATCH: style-guide
Date: Mon, 6 Sep 1999 13:24:02 +0200 (MET DST) [thread overview]
Message-ID: <199909061124.NAA01969@beta.informatik.hu-berlin.de> (raw)
Forgot to mention the funcall stuff.
Bye
Sven
--- Etc/completion-style-guide.old Mon Sep 6 13:23:16 1999
+++ Etc/completion-style-guide Mon Sep 6 13:22:50 1999
@@ -75,3 +75,24 @@
All this should make it look like a really good idea to just use the
supplied `_arguments' function to complete options.
+12) If at all possible, completion code for a command or a suite of
+ commands should go into only one file. If a command has sub-commands,
+ implementing aa state-machine might be a good idea. See the `_rpm'
+ and `_pbm' files for examples of different styles. Also see the
+ documentation for `_arguments' and `_values' for two functions
+ that may help you with this.
+13) If a completion function generates completely different types of
+ completions (for example, because the comamnd has several
+ completely different modes), it should allow users to define
+ functions that separately override the behavior for these
+ different types. This can easily be achieved by using the
+ `funcall' utility function, as in:
+
+ funcall ret _command_$subcommand && return ret
+
+ This will try to call the function `_command_$subcommand' and if
+ it exists, it will be called and the completion function exits
+ with its exit status. After this call to `funcall' the completion
+ function would contain the code for the default way to generate
+ the matches.
+ See the `_rpm' and `_nslookup' files for examples.
--
Sven Wischnowsky wischnow@informatik.hu-berlin.de
reply other threads:[~1999-09-06 11:24 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=199909061124.NAA01969@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).