Whamcloud - gitweb
git://git.whamcloud.com
/
fs
/
lustre-release.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
38dca2a
)
catch extra args without dashes
author
nathan
<nathan>
Thu, 8 Mar 2007 19:32:21 +0000
(19:32 +0000)
committer
nathan
<nathan>
Thu, 8 Mar 2007 19:32:21 +0000
(19:32 +0000)
lustre/utils/mkfs_lustre.c
patch
|
blob
|
history
diff --git
a/lustre/utils/mkfs_lustre.c
b/lustre/utils/mkfs_lustre.c
index
dc5ba4e
..
9c9f381
100644
(file)
--- a/
lustre/utils/mkfs_lustre.c
+++ b/
lustre/utils/mkfs_lustre.c
@@
-1164,15
+1164,15
@@
int parse_opts(int argc, char *const argv[], struct mkfs_opts *mop,
fatal();
fprintf(stderr, "Unknown option '%c'\n", opt);
}
fatal();
fprintf(stderr, "Unknown option '%c'\n", opt);
}
- usage(stderr);
- return 1;
+ return EINVAL;
}
}//while
}
}//while
- if (optind >= argc) {
+
+ /* Last arg is device */
+ if (optind != argc - 1) {
fatal();
fatal();
- fprintf(stderr, "Bad arguments\n");
- usage(stderr);
- return 1;
+ fprintf(stderr, "Bad argument: %s\n", argv[optind]);
+ return EINVAL;
}
return 0;
}
return 0;