+2001-09-08 Bruno Haible <haible@clisp.cons.org>
+
+ * msgcat.c (main): Move the option checking after the handling of
+ --version and --help, but before opening of any file.
+ * msgcomm.c (main): Move the option checking after the handling of
+ --version and --help.
+ * msguniq.c (main): Likewise.
+ * xgettext.c (main): Likewise.
+ * msgconv.c (main): Additional option checking for --sort-by-file.
+ * msgen.c (main): Likewise.
+ * msgexec.c (main): Likewise.
+ * msggrep.c (main): Likewise.
+ * msgmerge.c (main): Likewise.
+
2001-09-08 Bruno Haible <haible@clisp.cons.org>
* dir-list.c: Include specification header before all other headers.
/* NOTREACHED */
}
- /* 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");
-
/* Version information requested. */
if (do_version)
{
if (do_help)
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");
+
+ /* Check the message selection criteria for sanity. */
+ if (more_than >= less_than || less_than < 2)
+ error (EXIT_FAILURE, 0,
+ _("impossible selection criteria specified (%d < n < %d)"),
+ more_than, less_than);
+
/* Determine list of files we have to process. */
if (files_from != NULL)
file_list = read_names_from_file (files_from);
for (cnt = optind; cnt < argc; ++cnt)
string_list_append_unique (file_list, argv[cnt]);
- /* Check the message selection criteria for sanity. */
- if (more_than >= less_than || less_than < 2)
- error (EXIT_FAILURE, 0,
- _("impossible selection criteria specified (%d < n < %d)"),
- more_than, less_than);
-
/* Read input files, then filter, convert and merge messages. */
result = catenate_msgdomain_list (file_list, to_code);
/* NOTREACHED */
}
- /* 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");
-
/* Version information requested. */
if (do_version)
{
if (do_help)
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");
+
/* Determine list of files we have to process. */
if (files_from != NULL)
file_list = read_names_from_file (files_from);
usage (EXIT_FAILURE);
}
+ /* 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");
usage (EXIT_FAILURE);
}
+ /* 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");
error (EXIT_FAILURE, 0, _("missing filter name"));
sub_name = argv[optind];
+ /* 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");
+
/* Build argument list for the program. */
sub_argc = argc - optind;
sub_argv = (char **) xmalloc ((sub_argc + 1) * sizeof (char *));
}
}
- if (sort_by_msgid && sort_by_filepos)
- error (EXIT_FAILURE, 0, _("%s and %s are mutually exclusive"),
- "--sort-output", "--sort-by-file");
-
/* By default, input comes from standard input. */
if (input_file == NULL)
input_file = "-";
usage (EXIT_FAILURE);
}
+ /* 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");
usage (EXIT_FAILURE);
}
+ /* 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");
+ "--sort-output", "--sort-by-file");
/* merge the two files */
result = merge (argv[optind], argv[optind + 1]);
/* NOTREACHED */
}
- /* 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");
-
/* Version information requested. */
if (do_version)
{
usage (EXIT_FAILURE);
}
+ /* 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");
+
/* Determine list of files we have to process: a single file. */
file_list = string_list_alloc ();
string_list_append (file_list, input_file);
/* NOTREACHED */
}
+ /* Version information requested. */
+ if (do_version)
+ {
+ printf ("%s (GNU %s) %s\n", basename (program_name), PACKAGE, VERSION);
+ /* xgettext: no-wrap */
+ printf (_("Copyright (C) %s Free Software Foundation, Inc.\n\
+This is free software; see the source for copying conditions. There is NO\n\
+warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\
+"),
+ "1995-1998, 2000, 2001");
+ printf (_("Written by %s.\n"), "Ulrich Drepper");
+ exit (EXIT_SUCCESS);
+ }
+
+ /* Help is requested. */
+ if (do_help)
+ usage (EXIT_SUCCESS);
+
/* Normalize selected options. */
if (omit_header != 0 && line_comment < 0)
line_comment = 0;
+ /* Verify selected options. */
if (!line_comment && sort_by_filepos)
error (EXIT_FAILURE, 0, _("%s and %s are mutually exclusive"),
"--no-location", "--sort-by-file");
usage (EXIT_FAILURE);
}
- /* Version information requested. */
- if (do_version)
- {
- printf ("%s (GNU %s) %s\n", basename (program_name), PACKAGE, VERSION);
- /* xgettext: no-wrap */
- printf (_("Copyright (C) %s Free Software Foundation, Inc.\n\
-This is free software; see the source for copying conditions. There is NO\n\
-warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\
-"),
- "1995-1998, 2000, 2001");
- printf (_("Written by %s.\n"), "Ulrich Drepper");
- exit (EXIT_SUCCESS);
- }
-
- /* Help is requested. */
- if (do_help)
- usage (EXIT_SUCCESS);
-
/* Test whether we have some input files given. */
if (files_from == NULL && optind >= argc)
{