summaryrefslogtreecommitdiff
path: root/misc/snowflake/files/patch-sf.c
blob: 2731b1a53807c840e73dc52c3862248fe7832d6a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
--- sf.c.orig	Mon Dec 21 08:18:55 1998
+++ sf.c	Sat Nov  8 21:20:24 2003
@@ -47,6 +47,7 @@
 
 struct option long_options[] =
 {
+  { "version",          0, 0, c_VERSION          },
   { "view-geometry",    1, 0, c_VIEW_GEOMETRY    },
   { "control-geometry", 1, 0, c_CONTROL_GEOMETRY },
   { "minimize",         0, 0, c_MINIMIZE         },
@@ -77,6 +78,8 @@
 
 help_info_line help_info[] =
 {
+  { "version",          c_VERSION,          " ",
+    "show program version"  },
   { "view-geometry",    c_VIEW_GEOMETRY,    "+x+y",
     "Control window placement" },
   { "control-geometry", c_CONTROL_GEOMETRY, "+x+y",
@@ -134,7 +137,7 @@
 
 /* ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ */
 
-void main( int argc,char* argv[] )
+int main( int argc,char* argv[] )
 {
   int   i;
   char* shop;
@@ -175,7 +178,14 @@
                  help_info[i].description );
 
       exit( 0 );
-   }
+    }
+    /* asking for version? */
+    if ( ( strncmp( argv[1], "-V",   2 ) == 0 ) ||
+         ( strncmp( argv[1],"--version",3 ) == 0 ) )
+    {
+      printf( "%s - %s\n",program_name,version );
+      exit( 0 );
+    }
   }
 
   /* create shared memory image and mutex */