mirror of
https://github.com/opnsense/src.git
synced 2026-06-04 14:26:03 -04:00
Improved incorrect usage diagnostics.
This commit is contained in:
parent
5d8fdf31dd
commit
0222d5bc2d
1 changed files with 6 additions and 2 deletions
|
|
@ -169,8 +169,10 @@ main(int argc, char *argv[])
|
|||
argv += optind;
|
||||
|
||||
/* some options make no sense when creating directories */
|
||||
if (dostrip && dodir)
|
||||
if (dostrip && dodir) {
|
||||
warnx("-d and -s may not be specified together");
|
||||
usage();
|
||||
}
|
||||
|
||||
/* must have at least two arguments, except when creating directories */
|
||||
if (argc == 0 || (argc == 1 && !dodir))
|
||||
|
|
@ -213,8 +215,10 @@ main(int argc, char *argv[])
|
|||
}
|
||||
|
||||
/* can't do file1 file2 directory/file */
|
||||
if (argc != 2)
|
||||
if (argc != 2) {
|
||||
warnx("wrong number or types of arguments");
|
||||
usage();
|
||||
}
|
||||
|
||||
if (!no_target) {
|
||||
if (stat(*argv, &from_sb))
|
||||
|
|
|
|||
Loading…
Reference in a new issue