/* GNU gettext - internationalization aids
- Copyright (C) 1997-1998, 2000-2007, 2009-2012 Free Software Foundation, Inc.
+ Copyright (C) 1997-1998, 2000-2007, 2009-2015 Free Software
+ Foundation, Inc.
This file was written by Peter Miller <millerp@canb.auug.org.au>
/* Long options. */
static const struct option long_options[] =
{
- { "add-location", no_argument, &line_comment, 1 },
+ { "add-location", optional_argument, NULL, 'n' },
{ "color", optional_argument, NULL, CHAR_MAX + 5 },
{ "directory", required_argument, NULL, 'D' },
{ "escape", no_argument, NULL, 'E' },
{ "help", no_argument, NULL, 'h' },
{ "indent", no_argument, NULL, 'i' },
{ "no-escape", no_argument, NULL, 'e' },
- { "no-location", no_argument, &line_comment, 0 },
+ { "no-location", no_argument, NULL, CHAR_MAX + 7 },
{ "no-wrap", no_argument, NULL, CHAR_MAX + 2 },
{ "omit-header", no_argument, NULL, CHAR_MAX + 1 },
{ "output", required_argument, NULL, 'o' }, /* for backward compatibility */
break;
case 'n':
- line_comment = 1;
+ if (handle_filepos_comment_option (optarg))
+ usage (EXIT_FAILURE);
break;
case 'o':
handle_style_option (optarg);
break;
+ case CHAR_MAX + 7: /* --no-location */
+ message_print_style_filepos (filepos_comment_none);
+ break;
+
default:
usage (EXIT_FAILURE);
/* NOTREACHED */
usage (EXIT_SUCCESS);
/* Verify selected options. */
- if (!line_comment && sort_by_filepos)
- error (EXIT_FAILURE, 0, _("%s and %s are mutually exclusive"),
- "--no-location", "--sort-by-file");
-
if (sort_by_msgid && sort_by_filepos)
error (EXIT_FAILURE, 0, _("%s and %s are mutually exclusive"),
"--sort-output", "--sort-by-file");