* _arguments problems
@ 2000-02-03 19:14 Tanaka Akira
2000-02-04 6:12 ` flex -<TAB> Tanaka Akira
0 siblings, 1 reply; 4+ messages in thread
From: Tanaka Akira @ 2000-02-03 19:14 UTC (permalink / raw)
To: zsh-workers
Z:akr@is27e1u11% Src/zsh -f
is27e1u11% bindkey -e; autoload -U compinit; compinit -D; compdef _tst tst
is27e1u11% _tst () { _arguments "1:desc1:(arg1)" }
is27e1u11% tst <TAB>
This completes nothing but it should completes `arg1'.
is27e1u11% _tst () { _arguments '-a' '*::rest:_tst2' }
is27e1u11% _tst2 () { compadd - '-b' }
is27e1u11% tst arg -<TAB>
-b
-a
This completes `-a' and `-b' but it shouldn't completes `-a'.
--
Tanaka Akira
^ permalink raw reply [flat|nested] 4+ messages in thread
* flex -<TAB>
2000-02-03 19:14 _arguments problems Tanaka Akira
@ 2000-02-04 6:12 ` Tanaka Akira
2000-02-04 9:30 ` Alexandre Duret-Lutz
0 siblings, 1 reply; 4+ messages in thread
From: Tanaka Akira @ 2000-02-04 6:12 UTC (permalink / raw)
To: zsh-workers
Z(2):akr@is27e1u11% Src/zsh -f
is27e1u11% bindkey -e; autoload -U compinit; compinit -D; compdef _tst tst
is27e1u11% flex -<TAB>
- -- generate C++ scanner class
-7 -- generate 7-bit scanner
...
The option `+' isn't displayed.
--
Tanaka Akira
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: flex -<TAB>
2000-02-04 6:12 ` flex -<TAB> Tanaka Akira
@ 2000-02-04 9:30 ` Alexandre Duret-Lutz
0 siblings, 0 replies; 4+ messages in thread
From: Alexandre Duret-Lutz @ 2000-02-04 9:30 UTC (permalink / raw)
To: zsh-workers; +Cc: Tanaka Akira
>>> "Tanaka" == Tanaka Akira <akr@jaist.ac.jp> writes:
Tanaka> Z(2):akr@is27e1u11% Src/zsh -f
Tanaka> is27e1u11% bindkey -e; autoload -U compinit; compinit -D; compdef _tst tst
Tanaka> is27e1u11% flex -<TAB>
Tanaka> - -- generate C++ scanner class
Tanaka> -7 -- generate 7-bit scanner
Tanaka> ...
Tanaka> The option `+' isn't displayed.
I think this is since 9216. The character just after `-' in an argument
definition was not checked before, but now it is. And since `+' has a
special meaning for _arguments, perhaps the cleaner way to correct this is
to escape it.
Index: Completion/User/_flex
--- Completion/User/_flex Fri, 31 Dec 1999 13:32:44 +0100 Alexandre
+++ Completion/User/_flex Fri, 04 Feb 2000 10:04:17 +0100 Alexandre
@@ -24,7 +24,7 @@
'-V[show version]' \
'-7[generate 7-bit scanner]' \
'-8[generate 8-bit scanner]' \
- '-+[generate C++ scanner class]' \
+ '-\+[generate C++ scanner class]' \
'-C-[specify degree of table compression]:table compression:->tabcomp' \
'-o-[specify output file]:output file:_files' \
'-P-[change yy prefix]:prefix string:' \
--
Alexandre Duret-Lutz
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: flex -<TAB>
@ 2000-02-04 9:43 Sven Wischnowsky
0 siblings, 0 replies; 4+ messages in thread
From: Sven Wischnowsky @ 2000-02-04 9:43 UTC (permalink / raw)
To: zsh-workers
Alexandre Duret-Lutz wrote:
> >>> "Tanaka" == Tanaka Akira <akr@jaist.ac.jp> writes:
>
> Tanaka> Z(2):akr@is27e1u11% Src/zsh -f
> Tanaka> is27e1u11% bindkey -e; autoload -U compinit; compinit -D; compdef _tst tst
> Tanaka> is27e1u11% flex -<TAB>
> Tanaka> - -- generate C++ scanner class
> Tanaka> -7 -- generate 7-bit scanner
> Tanaka> ...
>
> Tanaka> The option `+' isn't displayed.
>
> I think this is since 9216. The character just after `-' in an argument
> definition was not checked before, but now it is. And since `+' has a
> special meaning for _arguments, perhaps the cleaner way to correct this is
> to escape it.
I think we better document this.
Bye
Sven
diff -ru ../z.old/Doc/Zsh/compsys.yo Doc/Zsh/compsys.yo
--- ../z.old/Doc/Zsh/compsys.yo Fri Feb 4 09:53:48 2000
+++ Doc/Zsh/compsys.yo Fri Feb 4 10:42:17 2000
@@ -2084,7 +2084,10 @@
and no other argument specification may be given after it.
In the simplest form the var(opt-spec) is just the option name
-beginning with a minus or a plus sign, such as `tt(-foo)'. In this
+beginning with a minus or a plus sign, such as `tt(-foo)'. If the
+command accepts the option both with a leading minus and a plus sign,
+one can use either tt(-+foo) or tt(+-foo) to define both options at
+once. In this
case, the first argument for the option (if any) has to come as a
separate word directly after the option and the option may appear only
once on the line (and if it is already on the line, the option name
@@ -2097,6 +2100,10 @@
instead. If the argument may be given as the next string or in same
string as the option name but separated from it by an equal sign, a
`tt(=)' should be used instead of the minus or plus sign.
+
+Note that this and the shortcut syntax with a leading tt(-+) or tt(+-)
+means that for options like tt(-+) the second character has to be
+quoted with a backslash.
If the option may be given more than once, a star
(`tt(*)') has to be added in front of the var(opt-spec).
--
Sven Wischnowsky wischnow@informatik.hu-berlin.de
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2000-02-04 9:43 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-02-03 19:14 _arguments problems Tanaka Akira
2000-02-04 6:12 ` flex -<TAB> Tanaka Akira
2000-02-04 9:30 ` Alexandre Duret-Lutz
2000-02-04 9:43 Sven Wischnowsky
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).