]> git.cworth.org Git - fips/blobdiff - fips.c
util-x11: Rework init_window interface to accept XVisualInfo
[fips] / fips.c
diff --git a/fips.c b/fips.c
index dbb8158b6ea0eee2b79ffed8b1dbb31f46802acc..5aeb8c3f10740ce97313d7a9ea38de926999477a 100644 (file)
--- a/fips.c
+++ b/fips.c
@@ -19,8 +19,8 @@
  * THE SOFTWARE.
  */
 
-#include <stdio.h>
-#include <stdlib.h>
+#include "fips.h"
+
 #include <limits.h>
 #include <getopt.h>
 
@@ -35,6 +35,7 @@ usage (void)
               "\n"
               "Options:\n"
               "        -h, --help      show this help message\n"
+              "        -v, --verbose   print verbose messages about fips activity"
               "\n");
 }
 
@@ -43,9 +44,20 @@ main (int argc, char *argv[])
 {
        int opt, ret;
 
-       const char *short_options = "h";
+       /* The initial '+' means that getopt will stop looking for
+        * options after the first non-option argument. This means
+        * that a command such as:
+        *
+        *      fips glxgears -fullscreen
+        *
+        * Will do what is intended, (namely, have fips invoke
+        * "glxgears -fullscreen" rather than trying to interpret
+        * -fullscreen as options to fips itself.
+        */
+       const char *short_options = "+hv";
        const struct option long_options[] = {
                {"help", no_argument, 0, 'h'},
+               {"verbose", no_argument, 0, 'v'},
                {0, 0, 0, 0}
        };
 
@@ -59,6 +71,9 @@ main (int argc, char *argv[])
                case 'h':
                        usage ();
                        return 0;
+               case 'v':
+                       setenv ("FIPS_VERBOSE", "1", 1);
+                       break;
                case '?':
                        break;
                default:
@@ -74,7 +89,7 @@ main (int argc, char *argv[])
                exit (1);
        }
 
-       ret = execute (argc - optind, &argv[optind]);
+       ret = execute_with_fips_preload (argc - optind, &argv[optind]);
 
        return ret;
 }