mirror of
https://github.com/samba-team/samba.git
synced 2025-01-24 02:04:21 +03:00
split_tokens: don't ignore unknown options
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14828 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
This commit is contained in:
parent
5562674a21
commit
b851d48277
@ -32,6 +32,7 @@ int main(int argc, const char *argv[])
|
||||
poptContext pc;
|
||||
char *buff;
|
||||
TALLOC_CTX *ctx = talloc_stackframe();
|
||||
int opt;
|
||||
bool ok;
|
||||
|
||||
struct poptOption long_options[] = {
|
||||
@ -64,7 +65,15 @@ int main(int argc, const char *argv[])
|
||||
|
||||
poptSetOtherOptionHelp(pc, "[OPTION...] <sequence-string>");
|
||||
|
||||
while(poptGetNextOpt(pc) != -1);
|
||||
while((opt = poptGetNextOpt(pc)) != -1) {
|
||||
switch (opt) {
|
||||
case POPT_ERROR_BADOPT:
|
||||
fprintf(stderr, "\nInvalid option %s: %s\n\n",
|
||||
poptBadOption(pc, 0), poptStrerror(opt));
|
||||
poptPrintUsage(pc, stderr, 0);
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
sequence = poptGetArg(pc);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user