* THE SOFTWARE.
*/
-#include <stdio.h>
-#include <stdlib.h>
+#include "fips.h"
+
#include <limits.h>
#include <getopt.h>
"\n"
"Options:\n"
" -h, --help show this help message\n"
+ " -v, --verbose print verbose messages about fips activity"
"\n");
}
{
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}
};
case 'h':
usage ();
return 0;
+ case 'v':
+ setenv ("FIPS_VERBOSE", "1", 1);
+ break;
case '?':
break;
default:
- fprintf(stderr, "Internal error: "
+ fprintf(stderr, "fips: Internal error: "
"unexpected getopt value: %d\n", opt);
exit (1);
}
exit (1);
}
- ret = execute_with_preload (argc - optind, &argv[optind], "libfips.so");
+ ret = execute_with_fips_preload (argc - optind, &argv[optind]);
return ret;
}