mirror of
git://git.9front.org/plan9front/plan9front
synced 2025-01-12 11:10:06 +00:00
ssh: add -h flag to pass host (for compatibility)
This commit is contained in:
parent
7ade57b678
commit
74b6d9bda3
2 changed files with 11 additions and 4 deletions
|
@ -17,6 +17,8 @@ ssh - secure shell remote login client
|
|||
.B -u
|
||||
.I user
|
||||
] [
|
||||
.B -h
|
||||
] [
|
||||
.IR user @] host
|
||||
[
|
||||
.I cmd
|
||||
|
|
|
@ -1129,7 +1129,7 @@ kfmt(Fmt *f)
|
|||
void
|
||||
usage(void)
|
||||
{
|
||||
fprint(2, "usage: %s [-dR] [-t thumbfile] [-T tries] [-u user] [user@]host [cmd args...]\n", argv0);
|
||||
fprint(2, "usage: %s [-dR] [-t thumbfile] [-T tries] [-u user] [-h] [user@]host [cmd args...]\n", argv0);
|
||||
exits("usage");
|
||||
}
|
||||
|
||||
|
@ -1159,6 +1159,9 @@ main(int argc, char *argv[])
|
|||
case 'u':
|
||||
user = EARGF(usage());
|
||||
break;
|
||||
case 'h':
|
||||
host = EARGF(usage());
|
||||
break;
|
||||
case 't':
|
||||
thumbfile = EARGF(usage());
|
||||
break;
|
||||
|
@ -1168,10 +1171,12 @@ main(int argc, char *argv[])
|
|||
break;
|
||||
} ARGEND;
|
||||
|
||||
if(argc == 0)
|
||||
usage();
|
||||
if(host == nil){
|
||||
if(argc == 0)
|
||||
usage();
|
||||
host = *argv++;
|
||||
}
|
||||
|
||||
host = *argv++;
|
||||
if(user == nil){
|
||||
s = strchr(host, '@');
|
||||
if(s != nil){
|
||||
|
|
Loading…
Reference in a new issue