Args for key path and addressbook path was capitalised and theirs long variants.
This commit is contained in:
parent
9d7383ec73
commit
4a03096436
17
src/main.c
17
src/main.c
@ -267,9 +267,22 @@ int parse_argv(int argc, const char **argv, struct options *opts) {
|
||||
|
||||
for (int i = 1; i < argc; ++i) {
|
||||
if (argv[i][0] == '-') {
|
||||
if (argv[i][1] == '-') {
|
||||
if (strncmp(&argv[i][2], "keys", 4) == 0) {
|
||||
opts->key_path = argv[i+1];
|
||||
++i;
|
||||
} else if (strncmp(&argv[i][2], "addressbook", 11) == 0) {
|
||||
opts->addressbook_path = argv[i+1];
|
||||
++i;
|
||||
} else {
|
||||
return -1;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
switch (argv[i][1]) {
|
||||
case 'k': opts->key_path = argv[i+1]; ++i; continue;
|
||||
case 'a': opts->addressbook_path = argv[i+1]; ++i; continue;
|
||||
case 'K': opts->key_path = argv[i+1]; ++i; continue;
|
||||
case 'A': opts->addressbook_path = argv[i+1]; ++i; continue;
|
||||
case 'v': return -2;
|
||||
case 'h': return -3;
|
||||
default: return -1;
|
||||
|
Loading…
Reference in New Issue
Block a user