diff options
author | Ryo Nakamura <upa@haeena.net> | 2023-11-25 15:49:09 +0900 |
---|---|---|
committer | Ryo Nakamura <upa@haeena.net> | 2023-11-25 15:49:09 +0900 |
commit | 2b71c4bf8c8c072661dbe0c1a0e7bfe1539cb439 (patch) | |
tree | e590df8d5bdcdaa1cc77aa881dd2184aad1c6ea1 /src | |
parent | 0cf3acee20f9b3f5c5961e754ab33c59b8dd4bb9 (diff) |
add -P, equivalent to -p for just compatibility
and add a test case for -p and -P
Diffstat (limited to 'src')
-rw-r--r-- | src/main.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -47,7 +47,7 @@ void usage(bool print_help) { " -r no effect\n" "\n" " -l LOGIN_NAME login name\n" - " -p PORT port number\n" + " -p/-P PORT port number\n" " -F CONFIG path to user ssh config (default ~/.ssh/config)\n" " -i IDENTITY identity file for public key authentication\n" " -c CIPHER cipher spec\n" @@ -255,7 +255,7 @@ int main(int argc, char **argv) o.severity = MSCP_SEVERITY_WARN; while ((ch = getopt(argc, argv, - "n:m:u:I:s:S:a:b:vqDrl:p:i:F:c:M:C:g:HdNh")) != -1) { + "n:m:u:I:s:S:a:b:vqDrl:P:p:i:F:c:M:C:g:HdNh")) != -1) { switch (ch) { case 'n': o.nr_threads = atoi(optarg); @@ -305,6 +305,8 @@ int main(int argc, char **argv) } strncpy(s.login_name, optarg, MSCP_SSH_MAX_LOGIN_NAME - 1); break; + case 'P': + /* fallthough for compatibility with scp */ case 'p': if (strlen(optarg) > MSCP_SSH_MAX_PORT_STR - 1) { fprintf(stderr, "long port string: %s\n", optarg); |