69 static struct option long_options[] = {
71 {
"single", no_argument, NULL, 0 },
72 {
"mono", no_argument, NULL, 0 },
73 {
"verbose", no_argument, NULL,
'v' },
74 {
"quiet", no_argument, NULL,
'q' },
75 {
"nowelcome", no_argument, NULL,
'W' },
78 {
"file", required_argument, NULL,
'f' },
79 {
"cfgchk", no_argument, NULL, 0 },
82 {
"help", no_argument, NULL,
'h' },
83 {
"version", no_argument, NULL, 0 },
84 {
"info", no_argument, NULL, 0 },
85 {
"dumpcfg", no_argument, NULL, 0 },
88 {
"display", required_argument, NULL,
'd' },
89 {
"xrm", required_argument, NULL, 0 },
91 {
"window", optional_argument, NULL,
'w' },
92 {
"name", required_argument, NULL, 0 },
96 {
"replace", no_argument, NULL, 0 },
101 {
"keep-defs", no_argument, NULL,
'k' },
102 {
"keep", required_argument, NULL,
'K' },
103 {
"nom4", no_argument, NULL,
'n' },
107 {
"clientId", required_argument, NULL, 0 },
108 {
"restore", required_argument, NULL, 0 },
110 { NULL, 0, NULL, 0 },
120 const char *short_options =
"vqWf:hd:"
136#define CHK(x) else if(strcmp(argv[1], (x)) == 0)
153 if(argc <= 2 || strlen(argv[2]) < 1) {
156 CLarg.display_name = strdup(argv[2]);
169 while((ch = getopt_long(argc, argv, short_options, long_options,
174 CLarg.PrintErrorMessages =
true;
177 CLarg.PrintErrorMessages =
false;
180 CLarg.ShowWelcomeWindow =
false;
183 CLarg.InitFile = optarg;
188 CLarg.display_name = optarg;
192 CLarg.is_captive =
true;
193 CLarg.MultiScreen =
false;
195 sscanf(optarg,
"%x", (
unsigned int *)&
CLarg.capwin);
204 CLarg.KeepTmpFile =
true;
207 CLarg.keepM4_filename = optarg;
210 CLarg.GoThroughM4 =
false;
220#define IFIS(x) if(strcmp(long_options[optidx].name, (x)) == 0)
223 CLarg.MultiScreen =
false;
227 CLarg.Monochrome =
true;
236 CLarg.ewmh_replace =
true;
244 CLarg.captivename = optarg;
249 CLarg.client_id = optarg;
253 CLarg.restore_filename = optarg;
286 if(long_options[optidx].flag != NULL) {
291 fprintf(stderr,
"Internal error in getopt: '%s' unhandled.\n",
292 long_options[optidx].name);
302 fprintf(stderr,
"Internal error: getopt confused us.\n");