/* GNU gettext - internationalization aids
- Copyright (C) 1995-1998, 2000-2010, 2012 Free Software Foundation, Inc.
+ Copyright (C) 1995-1998, 2000-2010, 2012, 2015 Free Software
+ Foundation, Inc.
This file was written by Peter Miller <millerp@canb.auug.org.au>
This program is free software: you can redistribute it and/or modify
/* Long options. */
static const struct option long_options[] =
{
- { "add-location", no_argument, &line_comment, 1 },
+ { "add-location", optional_argument, NULL, 'n' },
{ "backup", required_argument, NULL, CHAR_MAX + 1 },
{ "color", optional_argument, NULL, CHAR_MAX + 9 },
{ "compendium", required_argument, NULL, 'C', },
{ "multi-domain", no_argument, NULL, 'm' },
{ "no-escape", no_argument, NULL, 'e' },
{ "no-fuzzy-matching", no_argument, NULL, 'N' },
- { "no-location", no_argument, &line_comment, 0 },
+ { "no-location", no_argument, NULL, CHAR_MAX + 11 },
{ "no-wrap", no_argument, NULL, CHAR_MAX + 4 },
{ "output-file", required_argument, NULL, 'o' },
{ "previous", no_argument, NULL, CHAR_MAX + 7 },
bool do_help;
bool do_version;
char *output_file;
+ char *color;
msgdomain_list_ty *def;
msgdomain_list_ty *result;
catalog_input_format_ty input_syntax = &input_format_po;
do_help = false;
do_version = false;
output_file = NULL;
+ color = NULL;
- while ((opt = getopt_long (argc, argv, "C:D:eEFhimNo:pPqsUvVw:",
+ while ((opt = getopt_long (argc, argv, "C:D:eEFhimn:No:pPqsUvVw:",
long_options, NULL))
!= EOF)
switch (opt)
multi_domain_mode = true;
break;
+ case 'n':
+ if (handle_filepos_comment_option (optarg))
+ usage (EXIT_FAILURE);
+ break;
+
case 'N':
use_fuzzy_matching = false;
break;
case CHAR_MAX + 9: /* --color */
if (handle_color_option (optarg) || color_test_mode)
usage (EXIT_FAILURE);
+ color = optarg;
break;
case CHAR_MAX + 10: /* --style */
handle_style_option (optarg);
break;
+ case CHAR_MAX + 11: /* --no-location */
+ message_print_style_filepos (filepos_comment_none);
+ break;
+
default:
usage (EXIT_FAILURE);
break;
error (EXIT_FAILURE, 0, _("%s and %s are mutually exclusive"),
"--update", "--output-file");
}
+ if (color != NULL)
+ {
+ error (EXIT_FAILURE, 0, _("%s and %s are mutually exclusive"),
+ "--update", "--color");
+ }
+ if (style_file_name != NULL)
+ {
+ error (EXIT_FAILURE, 0, _("%s and %s are mutually exclusive"),
+ "--update", "--style");
+ }
}
else
{
}
}
- 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");
printf (_("\
--no-location suppress '#: filename:line' lines\n"));
printf (_("\
- --add-location preserve '#: filename:line' lines (default)\n"));
+ -n, --add-location preserve '#: filename:line' lines (default)\n"));
printf (_("\
--strict strict Uniforum output style\n"));
printf (_("\
char *extended =
(char *) obstack_alloc (&pool,
header_fields[UNKNOWN].len + len + 1);
- memcpy (extended, header_fields[UNKNOWN].string,
- header_fields[UNKNOWN].len);
+ if (header_fields[UNKNOWN].string)
+ memcpy (extended, header_fields[UNKNOWN].string,
+ header_fields[UNKNOWN].len);
memcpy (&extended[header_fields[UNKNOWN].len], cp, len);
extended[header_fields[UNKNOWN].len + len] = '\0';
header_fields[UNKNOWN].string = extended;
result->do_wrap = ref->do_wrap;
+ for (i = 0; i < NSYNTAXCHECKS; i++)
+ result->do_syntax_check[i] = ref->do_syntax_check[i];
+
/* Insert previous msgid, commented out with "#|".
Do so only when --previous is specified, for backward compatibility.
Since the "previous msgid" represents the original msgid that led to