Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: PATCH: _mutt, _mailboxes



I wrote:

> Adam Spiers wrote:
> 
> > Sven Wischnowsky (wischnow@xxxxxxxxxxxxxxxxxxxxxxx) wrote:
> > > And while I'm at it... I'm the only one who writes option
> > > descriptions, it seems, which I can understand considering how tedious 
> > > that is. So my question is: if an option gets only one argument,
> > > should we turn it's description automatically into the
> > > option-description? Probably prefixed by something like `specify: '?
> > 
> > Sounds like a good idea.  How about a configuration key which in this
> > case would be something like `specify: %s'?
> 
> Yep. It's `autodescribe_options' (and the sequence is `%d', for
> `description').

Oops. We won't want that for undescribed long options. And not for
empty descriptions.

Bye
 Sven

diff -u oldcompletion/Base/_arguments Completion/Base/_arguments
--- oldcompletion/Base/_arguments	Fri Sep 17 11:07:34 1999
+++ Completion/Base/_arguments	Fri Sep 17 13:20:38 1999
@@ -126,7 +126,7 @@
       # Then we walk through the descriptions plus a few builtin ones.
 
       set -- "$@" '*=FILE*:file:_files' \
-             '*=(DIR|PATH)*:directory:_files -/' '*:unknown:'
+             '*=(DIR|PATH)*:directory:_files -/' '*: :'
 
       while (( $# )); do
 
@@ -219,8 +219,8 @@
       1="${1/\[$descr\]}"
     elif [[ -n "$compconfig[autodescribe_options]" &&
             "$1" = [-+][^:]##:[^:]#[^\\]:[^:]# ]]; then
-      descr="${${(M)${1#*:}#*[^\\]:}[1,-2]}"
-      descr="${compconfig[autodescribe_options]//\\%d/$descr}"
+      descr="${${${${(M)${1#*:}#*[^\\]:}[1,-2]}## #}%% #}"
+      [[ -n "$descr" ]] && descr="${compconfig[autodescribe_options]//\\%d/$descr}"
     fi
 
     # Description for both the `-foo' and `+foo' form?

--
Sven Wischnowsky                         wischnow@xxxxxxxxxxxxxxxxxxxxxxx



Messages sorted by: Reverse Date, Date, Thread, Author