~ubuntu-branches/ubuntu/raring/vice/raring

« back to all changes in this revision

Viewing changes to src/cmdline.c

  • Committer: Bazaar Package Importer
  • Author(s): Laszlo Boszormenyi (GCS)
  • Date: 2009-03-31 00:37:15 UTC
  • mfrom: (1.2.2 upstream)
  • mto: This revision was merged to the branch mainline in revision 17.
  • Revision ID: james.westby@ubuntu.com-20090331003715-mzclchtl0dp7fcl0
Tags: upstream-2.1.dfsg
ImportĀ upstreamĀ versionĀ 2.1.dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
35
35
#include "cmdline.h"
36
36
#include "lib.h"
37
37
#include "resources.h"
38
 
#ifdef HAS_TRANSLATION
39
38
#include "translate.h"
40
 
#endif
41
39
#include "types.h"
42
40
#include "uicmdline.h"
43
41
#include "util.h"
82
80
        else
83
81
            p->resource_name = NULL;
84
82
        p->resource_value = c->resource_value;
 
83
 
 
84
        p->use_param_name_id = c->use_param_name_id;
 
85
        p->use_description_id = c->use_description_id;
 
86
 
85
87
        p->param_name = c->param_name;
86
88
        p->description = c->description;
87
89
 
 
90
        p->param_name_trans = c->param_name_trans;
 
91
        p->description_trans = c->description_trans;
 
92
 
88
93
        num_options++;
89
94
    }
90
95
 
220
225
    ui_cmdline_show_help(num_options, options, userparam);
221
226
}
222
227
 
 
228
char *cmdline_options_get_param(int counter)
 
229
{
 
230
    if (options[counter].use_param_name_id == USE_PARAM_ID)
 
231
        return translate_text(options[counter].param_name_trans);
 
232
    else
 
233
        return (char *)_(options[counter].param_name);
 
234
}
 
235
 
 
236
char *cmdline_options_get_description(int counter)
 
237
{
 
238
    if (options[counter].use_description_id == USE_DESCRIPTION_ID)
 
239
        return translate_text(options[counter].description_trans);
 
240
    else
 
241
        return (char *)_(options[counter].description);
 
242
}
 
243
 
223
244
char *cmdline_options_string(void)
224
245
{
225
246
    unsigned int i;
230
251
 
231
252
    for (i = 0; i < num_options; i++) {
232
253
        add_to_options1 = lib_msprintf("%s", options[i].name);
233
 
#ifdef HAS_TRANSLATION
234
 
        add_to_options3 = lib_msprintf("\n\t%s\n", translate_text(options[i].description));
235
 
        if (options[i].need_arg && options[i].param_name != 0) {
236
 
            add_to_options2 = lib_msprintf(" %s", translate_text(options[i].param_name));
237
 
#else
238
 
        add_to_options3 = lib_msprintf("\n\t%s\n", options[i].description);
239
 
        if (options[i].need_arg && options[i].param_name != NULL) {
240
 
            add_to_options2 = lib_msprintf(" %s", options[i].param_name);
241
 
#endif
 
254
        add_to_options3 = lib_msprintf("\n\t%s\n", cmdline_options_get_description(i));
 
255
        if (options[i].need_arg && cmdline_options_get_param(i) != NULL) {
 
256
            add_to_options2 = lib_msprintf(" %s", cmdline_options_get_param(i));
242
257
            new_cmdline_string = util_concat(cmdline_string, add_to_options1,
243
258
                                             add_to_options2, add_to_options3,
244
259
                                             NULL);