X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;f=fips.c;h=5aeb8c3f10740ce97313d7a9ea38de926999477a;hb=da0ee5e7efab316635f59d212028844f848fa6ce;hp=02f67bb80fd1e6983d4680d132f19c966f2e8065;hpb=c457e83d57b257f1f3aa7c39bbc0c60d127cc189;p=fips diff --git a/fips.c b/fips.c index 02f67bb..5aeb8c3 100644 --- a/fips.c +++ b/fips.c @@ -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: