X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;f=fips.c;h=5aeb8c3f10740ce97313d7a9ea38de926999477a;hb=d6ac766abe401b681282cdcf273e7fb67fff99bd;hp=ce76e31421a586032012ae52dbaad8aabede699f;hpb=5e4afc13a1514f253373e7054ef025baef9b0ed0;p=fips diff --git a/fips.c b/fips.c index ce76e31..5aeb8c3 100644 --- a/fips.c +++ b/fips.c @@ -19,11 +19,13 @@ * THE SOFTWARE. */ -#include -#include +#include "fips.h" + #include #include +#include "execute.h" + static void usage (void) { @@ -33,16 +35,29 @@ usage (void) "\n" "Options:\n" " -h, --help show this help message\n" + " -v, --verbose print verbose messages about fips activity" "\n"); } int main (int argc, char *argv[]) { - int opt; - const char *short_options = "h"; + int opt, ret; + + /* 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} }; @@ -56,6 +71,9 @@ main (int argc, char *argv[]) case 'h': usage (); return 0; + case 'v': + setenv ("FIPS_VERBOSE", "1", 1); + break; case '?': break; default: @@ -71,7 +89,9 @@ main (int argc, char *argv[]) exit (1); } - return 0; + ret = execute_with_fips_preload (argc - optind, &argv[optind]); + + return ret; }