4
void gui_term_process_cmdline(Conf *conf, char *cmdline)
7
bool special_launchable_argument = false;
9
settings_set_default_protocol(be_default_protocol);
10
/* Find the appropriate default port. */
12
const struct BackendVtable *vt =
13
backend_vt_from_proto(be_default_protocol);
14
settings_set_default_port(0); /* illegal */
16
settings_set_default_port(vt->default_port);
18
conf_set_int(conf, CONF_logtype, LGTYP_NONE);
20
do_defaults(NULL, conf);
22
p = handle_restrict_acl_cmdline_prefix(cmdline);
24
if (handle_special_sessionname_cmdline(p, conf)) {
25
if (!conf_launchable(conf) && !do_config(conf)) {
28
special_launchable_argument = true;
29
} else if (handle_special_filemapping_cmdline(p, conf)) {
30
special_launchable_argument = true;
32
/* Do-nothing case for an empty command line - or rather,
33
* for a command line that's empty _after_ we strip off
37
* Otherwise, break up the command line and deal with
43
split_into_argv(cmdline, &argc, &argv, NULL);
45
for (i = 0; i < argc; i++) {
49
ret = cmdline_process_param(p, i+1<argc?argv[i+1]:NULL,
52
cmdline_error("option \"%s\" requires an argument", p);
53
} else if (ret == 2) {
54
i++; /* skip next argument */
55
} else if (ret == 1) {
56
continue; /* nothing further needs doing */
57
} else if (!strcmp(p, "-cleanup")) {
59
* `putty -cleanup'. Remove all registry
60
* entries associated with PuTTY, and also find
61
* and delete the random seed file.
64
s1 = dupprintf("This procedure will remove ALL Registry entries\n"
65
"associated with %s, and will also remove\n"
66
"the random seed file. (This only affects the\n"
67
"currently logged-in user.)\n"
69
"THIS PROCESS WILL DESTROY YOUR SAVED SESSIONS.\n"
70
"Are you really sure you want to continue?",
72
s2 = dupprintf("%s Warning", appname);
73
if (message_box(NULL, s1, s2,
74
MB_YESNO | MB_ICONWARNING | MB_DEFBUTTON2,
75
HELPCTXID(option_cleanup)) == IDYES) {
81
} else if (!strcmp(p, "-pgpfp")) {
82
pgp_fingerprints_msgbox(NULL);
84
} else if (*p != '-') {
85
cmdline_error("unexpected argument \"%s\"", p);
87
cmdline_error("unknown option \"%s\"", p);
92
cmdline_run_saved(conf);
95
* Bring up the config dialog if the command line hasn't
96
* (explicitly) specified a launchable configuration.
98
if (!(special_launchable_argument || cmdline_host_ok(conf))) {
103
prepare_session(conf);
106
const struct BackendVtable *backend_vt_from_conf(Conf *conf)
109
* Select protocol. This is farmed out into a table in a
110
* separate file to enable an ssh-free variant.
112
const struct BackendVtable *vt = backend_vt_from_proto(
113
conf_get_int(conf, CONF_protocol));
115
char *str = dupprintf("%s Internal Error", appname);
116
MessageBox(NULL, "Unsupported protocol number found",
117
str, MB_OK | MB_ICONEXCLAMATION);
124
const wchar_t *get_app_user_model_id(void)
126
return L"SimonTatham.PuTTY";