2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
|
" -e COMMAND [ARGS...] Execute command (consumes all remaining args)\n"
) < 0 || fflush(fp) < 0) {
perror("output error");
exit(1);
}
}
int do_cmdline(int argc, char **argv, int do_everything,
struct gui_data *inst, Config *cfg)
{
int err = 0;
char *val;
/*
* Macros to make argument handling easier. Note that because
|
|
|
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
|
" -e COMMAND [ARGS...] Execute command (consumes all remaining args)\n"
) < 0 || fflush(fp) < 0) {
perror("output error");
exit(1);
}
}
int do_cmdline(int argc, char **argv, int do_everything, int *allow_launch,
struct gui_data *inst, Config *cfg)
{
int err = 0;
char *val;
/*
* Macros to make argument handling easier. Note that because
|
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
|
exit(0);
} else if (!strcmp(p, "-pgpfp")) {
pgp_fingerprints();
exit(1);
} else if(p[0] != '-' && (!do_everything ||
process_nonoption_arg(p, cfg))) {
/* do nothing */
} else {
err = 1;
fprintf(stderr, "%s: unrecognized option '%s'\n", appname, p);
}
}
|
|
>
|
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
|
exit(0);
} else if (!strcmp(p, "-pgpfp")) {
pgp_fingerprints();
exit(1);
} else if(p[0] != '-' && (!do_everything ||
process_nonoption_arg(p, cfg,
allow_launch))) {
/* do nothing */
} else {
err = 1;
fprintf(stderr, "%s: unrecognized option '%s'\n", appname, p);
}
}
|
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
|
}
if (argc > 1 && !strncmp(argv[1], "---", 3)) {
read_dupsession_data(inst, &inst->cfg, argv[1]);
/* Splatter this argument so it doesn't clutter a ps listing */
memset(argv[1], 0, strlen(argv[1]));
} else {
if (do_cmdline(argc, argv, 0, inst, &inst->cfg))
exit(1); /* pre-defaults pass to get -class */
do_defaults(NULL, &inst->cfg);
if (do_cmdline(argc, argv, 1, inst, &inst->cfg))
exit(1); /* post-defaults, do everything */
cmdline_run_saved(&inst->cfg);
if ((!loaded_session || !cfg_launchable(&inst->cfg)) &&
!cfgbox(&inst->cfg))
exit(0); /* config box hit Cancel */
}
if (!compound_text_atom)
compound_text_atom = gdk_atom_intern("COMPOUND_TEXT", FALSE);
if (!utf8_string_atom)
|
>
>
>
>
|
|
>
>
>
|
|
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
|
}
if (argc > 1 && !strncmp(argv[1], "---", 3)) {
read_dupsession_data(inst, &inst->cfg, argv[1]);
/* Splatter this argument so it doesn't clutter a ps listing */
memset(argv[1], 0, strlen(argv[1]));
} else {
/* By default, we bring up the config dialog, rather than launching
* a session. This gets set to TRUE if something happens to change
* that (e.g., a hostname is specified on the command-line). */
int allow_launch = FALSE;
if (do_cmdline(argc, argv, 0, &allow_launch, inst, &inst->cfg))
exit(1); /* pre-defaults pass to get -class */
do_defaults(NULL, &inst->cfg);
if (do_cmdline(argc, argv, 1, &allow_launch, inst, &inst->cfg))
exit(1); /* post-defaults, do everything */
cmdline_run_saved(&inst->cfg);
if (loaded_session)
allow_launch = TRUE;
if ((!allow_launch || !cfg_launchable(&inst->cfg)) &&
!cfgbox(&inst->cfg))
exit(0); /* config box hit Cancel */
}
if (!compound_text_atom)
compound_text_atom = gdk_atom_intern("COMPOUND_TEXT", FALSE);
if (!utf8_string_atom)
|