mirror of git://git.suckless.org/sbase
find: Make parameter error messages more specific
Differenciate option operands from path operands when an error is detected on the command line parameters.
This commit is contained in:
parent
870b26af8e
commit
4cf7643094
8
find.c
8
find.c
|
@ -809,8 +809,12 @@ parse(int argc, char **argv)
|
||||||
}
|
}
|
||||||
tok->type = op->type;
|
tok->type = op->type;
|
||||||
tok->u.oinfo = op;
|
tok->u.oinfo = op;
|
||||||
} else { /* token is neither primary nor operator, must be path in the wrong place */
|
} else {
|
||||||
eprintf("paths must precede expression: %s\n", *arg);
|
/* token is neither primary nor operator, must be */
|
||||||
|
if ((*arg)[0] == '-') /* an unsupported option */
|
||||||
|
eprintf("unknown operand: %s\n", *arg);
|
||||||
|
else /* or a path in the wrong place */
|
||||||
|
eprintf("paths must precede expression: %s\n", *arg);
|
||||||
}
|
}
|
||||||
if (tok->type != LPAR && tok->type != RPAR)
|
if (tok->type != LPAR && tok->type != RPAR)
|
||||||
ntok++; /* won't have parens in rpn */
|
ntok++; /* won't have parens in rpn */
|
||||||
|
|
Loading…
Reference in New Issue