mirror of
https://oauth2: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@github.com/m1ngsama/TNT.git
synced 2026-05-10 19:00:57 +08:00
fix: reject unknown command-line arguments instead of silently ignoring them
This commit is contained in:
parent
49674b75e8
commit
6c6c500134
1 changed files with 4 additions and 0 deletions
|
|
@ -45,6 +45,10 @@ int main(int argc, char **argv) {
|
||||||
printf(" -d DIR Store host key and logs in DIR\n");
|
printf(" -d DIR Store host key and logs in DIR\n");
|
||||||
printf(" -h Show this help\n");
|
printf(" -h Show this help\n");
|
||||||
return 0;
|
return 0;
|
||||||
|
} else {
|
||||||
|
fprintf(stderr, "Unknown option: %s\n", argv[i]);
|
||||||
|
fprintf(stderr, "Usage: %s [-p PORT] [-d DIR] [-h]\n", argv[0]);
|
||||||
|
return 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue