mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-05-28 07:14:48 -05:00
Add a load of new command-line options pilfered from OpenSSH. Full
list is: -A, -a, -X, -x, -T, -t, -C, -1, -2, -i keyfile. [originally from svn r1817]
This commit is contained in:
parent
6e00685af0
commit
6bfb676d8b
60
cmdline.c
60
cmdline.c
@ -222,7 +222,7 @@ int cmdline_process_param(char *p, char *value, int need_save)
|
||||
cfg.remote_cmd_ptr2 = NULL;
|
||||
cfg.nopty = TRUE; /* command => no terminal */
|
||||
}
|
||||
if (!strcmp(p, "-P")) {
|
||||
if (!strcmp(p, "-P") || !strcmp(p, "-p")) {
|
||||
RETURN(2);
|
||||
SAVEABLE(2); /* lower priority than -ssh,-telnet */
|
||||
cfg.port = atoi(value);
|
||||
@ -233,6 +233,64 @@ int cmdline_process_param(char *p, char *value, int need_save)
|
||||
ssh_get_line = cmdline_get_line;
|
||||
ssh_getline_pw_only = TRUE;
|
||||
}
|
||||
|
||||
if (!strcmp(p, "-A")) {
|
||||
RETURN(1);
|
||||
SAVEABLE(1);
|
||||
cfg.agentfwd = 1;
|
||||
}
|
||||
if (!strcmp(p, "-a")) {
|
||||
RETURN(1);
|
||||
SAVEABLE(1);
|
||||
cfg.agentfwd = 0;
|
||||
}
|
||||
|
||||
if (!strcmp(p, "-X")) {
|
||||
RETURN(1);
|
||||
SAVEABLE(1);
|
||||
cfg.x11_forward = 1;
|
||||
}
|
||||
if (!strcmp(p, "-x")) {
|
||||
RETURN(1);
|
||||
SAVEABLE(1);
|
||||
cfg.x11_forward = 0;
|
||||
}
|
||||
|
||||
if (!strcmp(p, "-t")) {
|
||||
RETURN(1);
|
||||
SAVEABLE(1);
|
||||
cfg.nopty = 0;
|
||||
}
|
||||
if (!strcmp(p, "-T")) {
|
||||
RETURN(1);
|
||||
SAVEABLE(1);
|
||||
cfg.nopty = 1;
|
||||
}
|
||||
|
||||
if (!strcmp(p, "-C")) {
|
||||
RETURN(1);
|
||||
SAVEABLE(1);
|
||||
cfg.compression = 1;
|
||||
}
|
||||
|
||||
if (!strcmp(p, "-1")) {
|
||||
RETURN(1);
|
||||
SAVEABLE(1);
|
||||
cfg.sshprot = 0; /* ssh protocol 1 only */
|
||||
}
|
||||
if (!strcmp(p, "-2")) {
|
||||
RETURN(1);
|
||||
SAVEABLE(1);
|
||||
cfg.sshprot = 3; /* ssh protocol 2 only */
|
||||
}
|
||||
|
||||
if (!strcmp(p, "-i")) {
|
||||
RETURN(2);
|
||||
SAVEABLE(1);
|
||||
strncpy(cfg.keyfile, value, sizeof(cfg.keyfile));
|
||||
cfg.keyfile[sizeof(cfg.keyfile)-1] = '\0';
|
||||
}
|
||||
|
||||
return ret; /* unrecognised */
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user