From: simon Date: Wed, 7 Aug 2002 17:55:06 +0000 (+0000) Subject: Add a load of new command-line options pilfered from OpenSSH. Full X-Git-Url: https://git.distorted.org.uk/u/mdw/putty/commitdiff_plain/34fb176efdb4b455db599985ed7d20e623abe03d 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. git-svn-id: svn://svn.tartarus.org/sgt/putty@1817 cda61777-01e9-0310-a592-d414129be87e --- diff --git a/cmdline.c b/cmdline.c index f26625ba..572a4335 100644 --- a/cmdline.c +++ b/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 */ }