mirror of
https://github.com/strongswan/strongswan.git
synced 2025-11-27 00:00:29 -05:00
swanctl: Add check for conflicting short options
This commit is contained in:
parent
f0c7cbd1d7
commit
c87b16d256
@ -147,6 +147,15 @@ void command_register(command_t command)
|
||||
"MAX_COMMANDS\n");
|
||||
return;
|
||||
}
|
||||
for (i = 0; i < MAX_COMMANDS && cmds[i].cmd; i++)
|
||||
{
|
||||
if (cmds[i].op == command.op)
|
||||
{
|
||||
fprintf(stderr, "unable to register command --%s, short option "
|
||||
"conflicts with --%s\n", command.cmd, cmds[i].cmd);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
cmds[registered] = command;
|
||||
/* append default options, but not to --help */
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user