[GRASS-dev] g.parser use G_parser()?

Is there a reason that the g.parser module doesn't use G_parser() for itself?

general/g.parser/main.c:

    /* Detect request to get strings to translate from a file */
    /* It comes BEFORE the filename to completely avoid confusion with parser.c behaviours */
    if (argc >= 2 && (strcmp (argv[1], "-t") == 0)) {
  /* Turn on translation output */
  translate_output = 1;
    }

    if (argc < 2 + translate_output)
    {
  fprintf(stderr, "Usage: %s [-t] <filename> [<argument> ...]\n", argv[0]);
  return 1;
    }

Hamish

Hamish wrote:

Is there a reason that the g.parser module doesn't use G_parser() for itself?

It can't call G_parser() until it has set up all of the options and
flags, but translate_output has to be set before it can do that.

Even if that wasn't the case, there would be other issues, e.g.
scripts being unable to have a -t flag, or being able to omit the
option name for the the first argument.

--
Glynn Clements <glynn@gclements.plus.com>