summaryrefslogtreecommitdiff
path: root/xcalc.c
diff options
context:
space:
mode:
Diffstat (limited to 'xcalc.c')
-rw-r--r--xcalc.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/xcalc.c b/xcalc.c
index f3ca18f..e188439 100644
--- a/xcalc.c
+++ b/xcalc.c
@@ -88,13 +88,15 @@ static unsigned char check_bits[] = {
/* command line options specific to the application */
static XrmOptionDescRec Options[] = {
{"-rpn", "rpn", XrmoptionNoArg, (XtPointer)"on"},
-{"-stipple", "stipple", XrmoptionNoArg, (XtPointer)"on"}
+{"-stipple", "stipple", XrmoptionNoArg, (XtPointer)"on"},
+{"-version", "version", XrmoptionNoArg, (XtPointer)"on"}
};
/* resources specific to the application */
static struct resources {
Boolean rpn; /* reverse polish notation (HP mode) */
Boolean stipple; /* background stipple */
+ Boolean version; /* print version */
Cursor cursor;
} appResources;
@@ -104,6 +106,8 @@ static XtResource Resources[] = {
offset(rpn), XtRImmediate, (XtPointer) False},
{"stipple", "Stipple", XtRBoolean, sizeof(Boolean),
offset(stipple), XtRImmediate, (XtPointer) False},
+{"version", "Version", XtRBoolean, sizeof(Boolean),
+ offset(version), XtRImmediate, (XtPointer) False},
{"cursor", "Cursor", XtRCursor, sizeof(Cursor),
offset(cursor), XtRCursor, (XtPointer)NULL}
};
@@ -127,6 +131,12 @@ main(int argc, char **argv)
XtGetApplicationResources(toplevel, (XtPointer)&appResources, Resources,
XtNumber(Resources), (ArgList) NULL, ZERO);
+ if (appResources.version)
+ {
+ puts(PACKAGE_STRING);
+ exit(0);
+ }
+
create_calculator(toplevel);
XtAppAddActions(xtcontext, Actions, ActionsCount);