~ubuntu-branches/ubuntu/maverick/gcalctool/maverick

« back to all changes in this revision

Viewing changes to src/calctool.c

  • Committer: Bazaar Package Importer
  • Author(s): Robert Ancell
  • Date: 2009-12-22 10:06:16 UTC
  • mfrom: (1.1.63 upstream)
  • Revision ID: james.westby@ubuntu.com-20091222100616-5ir8k6orw75omhdi
Tags: 5.29.4-0ubuntu1
* New upstream release:
  * Make 0^0 = 1
  * Use superscript digits for scientific notation
  * Clear display when entering a number after an equation
  * Make Ctrl+W a shortcut to quit
  * Updated translations

Show diffs side-by-side

added added

removed removed

Lines of Context:
73
73
static void
74
74
usage(int show_gtk)
75
75
{
76
 
    /* Translators: Description on how to use gcalctool displayed on command-line */
77
76
    fprintf(stderr,
 
77
            /* Description on how to use gcalctool displayed on command-line */
78
78
            _("Usage:\n"
79
79
              "  %s - Perform mathematical calculations"), v->progname);
80
80
 
81
81
    fprintf(stderr,
82
82
            "\n\n");
83
83
 
84
 
    /* Translators: Description on gcalctool command-line help options displayed on command-line */
85
84
    fprintf(stderr,
 
85
            /* Description on gcalctool command-line help options displayed on command-line */
86
86
            _("Help Options:\n"
87
87
              "  -v, --version                   Show release version\n"
88
88
              "  -h, -?, --help                  Show help options\n"
92
92
            "\n\n");
93
93
 
94
94
    if (show_gtk) {
95
 
        /* Translators: Description on gcalctool command-line GTK+ options displayed on command-line */
96
95
        fprintf(stderr,
 
96
                /* Description on gcalctool command-line GTK+ options displayed on command-line */
97
97
                _("GTK+ Options:\n"
98
98
                  "  --class=CLASS                   Program class as used by the window manager\n"
99
99
                  "  --name=NAME                     Program name as used by the window manager\n"
105
105
                "\n\n");
106
106
    }
107
107
 
108
 
    /* Translators: Description on gcalctool application options displayed on command-line */
109
108
    fprintf(stderr,
 
109
            /* Description on gcalctool application options displayed on command-line */
110
110
            _("Application Options:\n"
111
111
              "  -u, --unittest                  Perform unittests\n"
112
112
              "  -s, --solve <equation>          Solve the given equation"));
124
124
        arg = argv[i];
125
125
 
126
126
        if (strcmp(arg, "-v") == 0 ||
127
 
                 strcmp(arg, "--version") == 0 ||
128
 
                 strcmp(arg, "-?") == 0) {
 
127
            strcmp(arg, "--version") == 0) {
129
128
            version();
130
129
            exit(0);
131
130
        }
132
131
        else if (strcmp(arg, "-h") == 0 ||
 
132
                 strcmp(arg, "-?") == 0 ||
133
133
                 strcmp(arg, "--help") == 0) {
134
134
            usage(FALSE);
135
135
            exit(0);
142
142
            strcmp(arg, "--solve") == 0) {
143
143
            i++;
144
144
            if (i >= argc) {
145
 
                /* Translators: Error printed to stderr when user uses --solve argument without an equation */
146
 
                fprintf(stderr, _("Argument --solve requires an equation to solve"));
 
145
                fprintf(stderr,
 
146
                        /* Error printed to stderr when user uses --solve argument without an equation */
 
147
                        _("Argument --solve requires an equation to solve"));
147
148
                fprintf(stderr, "\n");
148
149
                exit(1);
149
150
            }
155
156
            unittest();
156
157
        }
157
158
        else {
158
 
            /* Translators: Error printed to stderr when user provides an unknown command-line argument */
159
 
            fprintf(stderr, _("Unknown argument '%s'"), arg);
 
159
            fprintf(stderr,
 
160
                    /* Error printed to stderr when user provides an unknown command-line argument */
 
161
                    _("Unknown argument '%s'"), arg);
160
162
            fprintf(stderr, "\n");
161
163
            usage(FALSE);
162
164
            exit(1);