| … | |
… | |
| 31 | * Version 1.0.5: Tue Jun 22 1999 |
31 | * Version 1.0.5: Tue Jun 22 1999 |
| 32 | * Make -u option work (not present) |
32 | * Make -u option work (not present) |
| 33 | * Version 1.0.6: Tue Jun 27 2000 |
33 | * Version 1.0.6: Tue Jun 27 2000 |
| 34 | * No important changes |
34 | * No important changes |
| 35 | * Version 1.1.0: Tue Jun 30 2000 |
35 | * Version 1.1.0: Tue Jun 30 2000 |
| 36 | * Added NLS support (partly written by Arkadiusz Mi<B6>kiewicz |
36 | * Added NLS support (partly written by Arkadiusz Miśkiewicz |
| 37 | * <misiek@pld.org.pl>) |
37 | * <misiek@pld.org.pl>) |
| 38 | * Version 1.1.4: Mon Nov 7 2005 |
38 | * Version 1.1.4: Mon Nov 7 2005 |
| 39 | * Fixed a few type's in the manpage |
39 | * Fixed a few type's in the manpage |
| 40 | * Version 1.1.5: Mon Nov 7 2005 |
40 | * Version 1.1.5: Sun Aug 12 2012 |
| 41 | * Sync with util-linux-2.21, fixed build problems, many new translations |
41 | * Sync with util-linux-2.21, fixed build problems, many new translations |
| 42 | */ |
42 | */ |
| 43 | |
43 | |
| 44 | /* Exit codes: |
44 | /* Exit codes: |
| 45 | * 0) No errors, succesful operation. |
45 | * 0) No errors, succesful operation. |
| … | |
… | |
| 197 | if (opt == LONG_OPT) { |
197 | if (opt == LONG_OPT) { |
| 198 | printf(" --%s", longopts[longindex].name); |
198 | printf(" --%s", longopts[longindex].name); |
| 199 | if (longopts[longindex].has_arg) |
199 | if (longopts[longindex].has_arg) |
| 200 | printf(" %s", normalize(optarg ? optarg : "")); |
200 | printf(" %s", normalize(optarg ? optarg : "")); |
| 201 | } else if (opt == NON_OPT) |
201 | } else if (opt == NON_OPT) |
| 202 | printf(" %s", normalize(optarg)); |
202 | printf(" %s", normalize(optarg ? optarg : "")); |
| 203 | else { |
203 | else { |
| 204 | printf(" -%c", opt); |
204 | printf(" -%c", opt); |
| 205 | charptr = strchr(optstr, opt); |
205 | charptr = strchr(optstr, opt); |
| 206 | if (charptr != NULL && *++charptr == ':') |
206 | if (charptr != NULL && *++charptr == ':') |
| 207 | printf(" %s", normalize(optarg ? optarg : "")); |
207 | printf(" %s", normalize(optarg ? optarg : "")); |
| … | |
… | |
| 258 | long_options[long_options_nr].name = NULL; |
258 | long_options[long_options_nr].name = NULL; |
| 259 | long_options[long_options_nr].has_arg = 0; |
259 | long_options[long_options_nr].has_arg = 0; |
| 260 | long_options[long_options_nr].flag = NULL; |
260 | long_options[long_options_nr].flag = NULL; |
| 261 | long_options[long_options_nr].val = 0; |
261 | long_options[long_options_nr].val = 0; |
| 262 | |
262 | |
| 263 | if (long_options_nr) { |
263 | if (long_options_nr && name) { |
| 264 | /* Not for init! */ |
264 | /* Not for init! */ |
| 265 | long_options[long_options_nr - 1].has_arg = has_arg; |
265 | long_options[long_options_nr - 1].has_arg = has_arg; |
| 266 | long_options[long_options_nr - 1].flag = NULL; |
266 | long_options[long_options_nr - 1].flag = NULL; |
| 267 | long_options[long_options_nr - 1].val = LONG_OPT; |
267 | long_options[long_options_nr - 1].val = LONG_OPT; |
| 268 | tmp = xmalloc(strlen(name) + 1); |
268 | tmp = xmalloc(strlen(name) + 1); |
| … | |
… | |
| 332 | fputs(_(" -o, --options <optstring> Short options to be recognized\n"), stderr); |
332 | fputs(_(" -o, --options <optstring> Short options to be recognized\n"), stderr); |
| 333 | fputs(_(" -q, --quiet Disable error reporting by getopt(3)\n"), stderr); |
333 | fputs(_(" -q, --quiet Disable error reporting by getopt(3)\n"), stderr); |
| 334 | fputs(_(" -Q, --quiet-output No normal output\n"), stderr); |
334 | fputs(_(" -Q, --quiet-output No normal output\n"), stderr); |
| 335 | fputs(_(" -s, --shell <shell> Set shell quoting conventions\n"), stderr); |
335 | fputs(_(" -s, --shell <shell> Set shell quoting conventions\n"), stderr); |
| 336 | fputs(_(" -T, --test Test for getopt(1) version\n"), stderr); |
336 | fputs(_(" -T, --test Test for getopt(1) version\n"), stderr); |
| 337 | fputs(_(" -u, --unquote Do not quote the output\n"), stderr); |
337 | fputs(_(" -u, --unquoted Do not quote the output\n"), stderr); |
| 338 | fputs(_(" -V, --version Output version information\n"), stderr); |
338 | fputs(_(" -V, --version Output version information\n"), stderr); |
| 339 | fputc('\n', stderr); |
339 | fputc('\n', stderr); |
| 340 | |
340 | |
| 341 | exit(PARAMETER_EXIT_CODE); |
341 | exit(PARAMETER_EXIT_CODE); |
| 342 | } |
342 | } |