Changeset d8dbdff in git


Ignore:
Timestamp:
21/09/11 13:54:07 (8 years ago)
Author:
Olly Betts <olly@…>
Branches:
add-show-splays, line_contents, master, stereo, svn/github/master, svn/origin/master, svn/tags/1.2.1, svn/tags/1.2.2, svn/tags/1.2.3, svn/tags/1.2.4, svn/tags/1.2.5, svn/trunk, travis-osx
Children:
857408e
Parents:
b775443
Message:

lib/codes.po,src/: cmdline_set_syntax_message() now takes message
numbers, plus an optional string argument.

git-svn-id: file:///home/survex-svn/survex/trunk@3746 4b37db11-9a0c-4f06-9ece-9ab7cdaee568

Files:
9 edited

Legend:

Unmodified
Added
Removed
  • ChangeLog

    rb775443 rd8dbdff  
     1Wed Sep 21 12:53:02 GMT 2011  Olly Betts <olly@survex.com>
     2
     3        * lib/codes.po,src/: cmdline_set_syntax_message() now takes message
     4          numbers, plus an optional string argument.
     5
    16Wed Sep 21 12:17:19 GMT 2011  Olly Betts <olly@survex.com>
    27
  • lib/codes.po

    rb775443 rd8dbdff  
    12671267msgstr "219"
    12681268
     1269#. TRANSLATORS: Part of 3dtopos --help
     1270msgid "3D_FILE [POS_FILE]"
     1271msgstr "217"
     1272
     1273#. TRANSLATORS: Part of diffpos --help
     1274msgid "FILE1 FILE2 [THRESHOLD]"
     1275msgstr "218"
     1276
     1277#. TRANSLATORS: Part of diffpos --help
     1278msgid "FILE1 and FILE2 can be .pos or .3d files\nTHRESHOLD is the max. ignorable change along any axis in metres (default %s)"
     1279msgstr "255"
     1280
     1281#. TRANSLATORS: Part of extend --help
     1282msgid "INPUT_3D_FILE [OUTPUT_3D_FILE]"
     1283msgstr "267"
     1284
     1285#. TRANSLATORS: Part of sorterr --help
     1286msgid "ERR_FILE [HOW MANY]"
     1287msgstr "268"
     1288
     1289#. TRANSLATORS: Part of aven --help
     1290msgid "[SURVEY_FILE]"
     1291msgstr "269"
     1292
    12691293#. TRANSLATORS: Aven menu items.  An '&' goes before the letter of any accelerator key.
    12701294#. The string "\t" separates the menu text and any accelerator key.
  • src/3dtopos.c

    rb775443 rd8dbdff  
    8383   msg_init(argv);
    8484
    85    cmdline_set_syntax_message("3D_FILE [POS_FILE]", NULL); /* TRANSLATE */
     85   cmdline_set_syntax_message(/*3D_FILE [POS_FILE]*/217, 0, NULL);
    8686   cmdline_init(argc, argv, short_opts, long_opts, NULL, help, 1, 2);
    8787   while (1) {
  • src/aven.cc

    rb775443 rd8dbdff  
    100100     * wxCmdLine is much less good.
    101101     */
    102     cmdline_set_syntax_message("[3d file]", NULL);
     102    cmdline_set_syntax_message(/*[SURVEY_FILE]*/269, 0, NULL);
    103103    cmdline_init(my_argc, utf8_argv, short_opts, long_opts, NULL, help, 0, 1);
    104104    getopt_first_response = cmdline_getopt();
     
    127127     * wxCmdLine is much less good.
    128128     */
    129     cmdline_set_syntax_message("[3d file]", NULL);
     129    cmdline_set_syntax_message(/*[SURVEY_FILE]*/269, 0, NULL);
    130130    cmdline_init(argc, argv, short_opts, long_opts, NULL, help, 0, 1);
    131131    getopt_first_response = cmdline_getopt();
  • src/cmdline.c

    rb775443 rd8dbdff  
    7777static const struct help_msg *help;
    7878static int min_args, max_args;
    79 static const char *args_msg = NULL, *extra_msg = NULL;
     79static int msg_args, msg_extra;
     80static const char * msg_extra_arg;
    8081
    8182void
     
    138139   puts(msg(/*output version information and exit*/151));
    139140
    140    if (extra_msg) {
     141   if (msg_extra) {
    141142      putnl();
    142       puts(extra_msg);
     143      if (msg_extra_arg) {
     144          SVX_ASSERT(strstr(msg(msg_extra), "%s") != NULL);
     145          printf(msg(msg_extra), msg_extra_arg);
     146          putnl();
     147      } else {
     148          SVX_ASSERT(strstr(msg(msg_extra), "%s") == NULL);
     149          puts(msg(msg_extra));
     150      }
    143151   }
    144152
     
    157165   printf("\n%s: %s", msg(/*Syntax*/49), msg_appname());
    158166   if (help->opt) printf(" [%s]...", msg(/*OPTION*/153));
    159    if (args_msg) {
     167   if (msg_args) {
    160168      putchar(' ');
    161       puts(args_msg);
     169      puts(msg(msg_args));
    162170      return;
    163171   }
     
    210218
    211219void
    212 cmdline_set_syntax_message(const char *args, const char *extra)
    213 {
    214    args_msg = args;
    215    extra_msg = extra;
     220cmdline_set_syntax_message(int msg_args_, int msg_extra_, const char * arg)
     221{
     222   msg_args = msg_args_;
     223   msg_extra = msg_extra_;
     224   msg_extra_arg = arg;
    216225}
    217226
  • src/cmdline.h

    rb775443 rd8dbdff  
    6060                  const struct help_msg *help_,
    6161                  int min_args_, int max_args_);
    62 /* if args not NULL, use instead of auto-generated FILE args */
    63 /* if extra not NULL, display as extra blurb at end */
    64 void cmdline_set_syntax_message(const char *args, const char *extra);
     62/* if args not 0, use instead of auto-generated FILE args */
     63/* if extra not 0, display as extra blurb at end */
     64/* if arg not NULL, extra must be a printf format with one %s */
     65void cmdline_set_syntax_message(int msg_args, int msg_extra, const char * arg);
    6566int cmdline_getopt(void);
    6667void cmdline_help(void);
  • src/diffpos.c

    rb775443 rd8dbdff  
    259259   msg_init(argv);
    260260
    261    cmdline_set_syntax_message("FILE1 FILE2 [THRESHOLD]",
    262                               "FILE1 and FILE2 can be .pos or .3d files\n"
    263                               "THRESHOLD is the max. ignorable change along "
    264                               "any axis in metres (default "
    265                               STRING(DFLT_MAX_THRESHOLD)")");
     261   cmdline_set_syntax_message(/*FILE1 FILE2 [THRESHOLD]*/218,
     262                              /*FILE1 and FILE2 can be .pos or .3d files\nTHRESHOLD is the max. ignorable change along any axis in metres (default %s)*/255,
     263                              STRING(DFLT_MAX_THRESHOLD));
    266264   cmdline_init(argc, argv, short_opts, long_opts, NULL, help, 2, 3);
    267265   while (1) {
  • src/extend.c

    rb775443 rd8dbdff  
    462462   msg_init(argv);
    463463
    464    cmdline_set_syntax_message("INPUT_3D_FILE [OUTPUT_3D_FILE]", NULL);
     464   cmdline_set_syntax_message(/*INPUT_3D_FILE [OUTPUT_3D_FILE]*/267, 0, NULL);
    465465   cmdline_init(argc, argv, short_opts, long_opts, NULL, help, 1, 2);
    466466   while (1) {
  • src/sorterr.c

    rb775443 rd8dbdff  
    119119   msg_init(argv);
    120120
    121    cmdline_set_syntax_message("ERR_FILE [HOW MANY]", NULL); /* TRANSLATE */
     121   cmdline_set_syntax_message(/*ERR_FILE [HOW MANY]*/268, 0, NULL);
    122122   cmdline_init(argc, argv, short_opts, long_opts, NULL, help, 1, 2);
    123123   while (1) {
Note: See TracChangeset for help on using the changeset viewer.