mirror of
https://github.com/vortexgpgpu/vortex.git
synced 2025-04-24 22:07:41 -04:00
fixed getopt exitcode with invalid parameters
This commit is contained in:
parent
2041a4ad4a
commit
a75ed78bf2
26 changed files with 57 additions and 86 deletions
|
@ -147,16 +147,15 @@ static void show_usage() {
|
|||
|
||||
static void parse_args(int argc, char **argv) {
|
||||
int c;
|
||||
while ((c = getopt(argc, argv, "n:h?")) != -1) {
|
||||
while ((c = getopt(argc, argv, "n:h")) != -1) {
|
||||
switch (c) {
|
||||
case 'n':
|
||||
size = atoi(optarg);
|
||||
break;
|
||||
case 'h':
|
||||
case '?': {
|
||||
show_usage();
|
||||
exit(0);
|
||||
} break;
|
||||
break;
|
||||
default:
|
||||
show_usage();
|
||||
exit(-1);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue