git-svn: trunk@2714
Tomasz Kojm authored on 2007/02/13 04:11:40... | ... |
@@ -1,5 +1,5 @@ |
1 | 1 |
/* |
2 |
- * Copyright (C) 2001 - 2006 Tomasz Kojm <tkojm@clamav.net> |
|
2 |
+ * Copyright (C) 2001 - 2007 Tomasz Kojm <tkojm@clamav.net> |
|
3 | 3 |
* |
4 | 4 |
* This program is free software; you can redistribute it and/or modify |
5 | 5 |
* it under the terms of the GNU General Public License as published by |
... | ... |
@@ -61,7 +61,11 @@ static int register_option(struct optstruct *opt, const char *optlong, char opts |
61 | 61 |
found = 1; |
62 | 62 |
|
63 | 63 |
if(!found) { |
64 |
- mprintf("WARNING: Ignoring option --%s\n", optlong); |
|
64 |
+ if(optshort) |
|
65 |
+ mprintf("WARNING: Ignoring option --%s (-%c)\n", longname, optshort); |
|
66 |
+ else |
|
67 |
+ mprintf("WARNING: Ignoring option --%s\n", longname); |
|
68 |
+ |
|
65 | 69 |
return 0; |
66 | 70 |
} |
67 | 71 |
} |
... | ... |
@@ -158,7 +162,7 @@ struct optstruct *opt_parse(int argc, char * const *argv, const char *getopt_sho |
158 | 158 |
else |
159 | 159 |
longname = NULL; |
160 | 160 |
|
161 |
- if(register_option(opt, options_long[opt_index].name, ret, options_long, accepted_long) == -1) { |
|
161 |
+ if(register_option(opt, longname, ret, options_long, accepted_long) == -1) { |
|
162 | 162 |
opt_free(opt); |
163 | 163 |
return NULL; |
164 | 164 |
} |