mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-06-09 06:28:06 +02:00
40010: builtins: Say 'bad option: +x', not 'bad option: -x', when +x was passed.
This commit is contained in:
parent
3a8727dc6b
commit
a81f280bfa
3 changed files with 11 additions and 2 deletions
|
@ -1,5 +1,8 @@
|
||||||
2016-11-28 Daniel Shahaf <d.s@daniel.shahaf.name>
|
2016-11-28 Daniel Shahaf <d.s@daniel.shahaf.name>
|
||||||
|
|
||||||
|
* 40010: Src/builtin.c, Test/A02alias.ztst: builtins: Say
|
||||||
|
'bad option: +x', not 'bad option: -x', when +x was passed.
|
||||||
|
|
||||||
* 40009: Src/hashtable.c: alias -L: Emit aliases that begin
|
* 40009: Src/hashtable.c: alias -L: Emit aliases that begin
|
||||||
with a plus sign correctly.
|
with a plus sign correctly.
|
||||||
|
|
||||||
|
|
|
@ -249,7 +249,7 @@ int
|
||||||
execbuiltin(LinkList args, LinkList assigns, Builtin bn)
|
execbuiltin(LinkList args, LinkList assigns, Builtin bn)
|
||||||
{
|
{
|
||||||
char *pp, *name, *optstr;
|
char *pp, *name, *optstr;
|
||||||
int flags, sense, argc, execop, xtr = isset(XTRACE);
|
int flags, argc, execop, xtr = isset(XTRACE);
|
||||||
struct options ops;
|
struct options ops;
|
||||||
|
|
||||||
/* initialise options structure */
|
/* initialise options structure */
|
||||||
|
@ -294,6 +294,7 @@ execbuiltin(LinkList args, LinkList assigns, Builtin bn)
|
||||||
/* Sort out the options. */
|
/* Sort out the options. */
|
||||||
if (optstr) {
|
if (optstr) {
|
||||||
char *arg = *argv;
|
char *arg = *argv;
|
||||||
|
int sense; /* 1 for -x, 0 for +x */
|
||||||
/* while arguments look like options ... */
|
/* while arguments look like options ... */
|
||||||
while (arg &&
|
while (arg &&
|
||||||
/* Must begin with - or maybe + */
|
/* Must begin with - or maybe + */
|
||||||
|
@ -387,7 +388,7 @@ execbuiltin(LinkList args, LinkList assigns, Builtin bn)
|
||||||
if (*arg) {
|
if (*arg) {
|
||||||
if(*arg == Meta)
|
if(*arg == Meta)
|
||||||
*++arg ^= 32;
|
*++arg ^= 32;
|
||||||
zwarnnam(name, "bad option: -%c", *arg);
|
zwarnnam(name, "bad option: %c%c", "+-"[sense], *arg);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
arg = *++argv;
|
arg = *++argv;
|
||||||
|
|
|
@ -110,3 +110,8 @@
|
||||||
127:No endless loop with suffix alias in command position
|
127:No endless loop with suffix alias in command position
|
||||||
>You said it.
|
>You said it.
|
||||||
?(eval):1: command not found: thingummy.mysuff
|
?(eval):1: command not found: thingummy.mysuff
|
||||||
|
|
||||||
|
alias +x; alias -z
|
||||||
|
1:error message has the correct sign
|
||||||
|
?(eval):alias:1: bad option: +x
|
||||||
|
?(eval):alias:1: bad option: -z
|
||||||
|
|
Loading…
Reference in a new issue