aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/9p.c
diff options
context:
space:
mode:
authorrsc <devnull@localhost>2005-03-21 17:27:25 +0000
committerrsc <devnull@localhost>2005-03-21 17:27:25 +0000
commit011090f03b7a9f83646dbdd24f321b93e6733a73 (patch)
tree032256b653df5b9df36f484c1acf7dd7349c1510 /src/cmd/9p.c
parent5c84c448b82c7bfdfeaae533783aa09317656e86 (diff)
downloadplan9port-011090f03b7a9f83646dbdd24f321b93e6733a73.tar.gz
plan9port-011090f03b7a9f83646dbdd24f321b93e6733a73.tar.bz2
plan9port-011090f03b7a9f83646dbdd24f321b93e6733a73.zip
add -A
Diffstat (limited to 'src/cmd/9p.c')
-rw-r--r--src/cmd/9p.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/cmd/9p.c b/src/cmd/9p.c
index 22446b2e..909bfeb6 100644
--- a/src/cmd/9p.c
+++ b/src/cmd/9p.c
@@ -12,7 +12,7 @@ char *addr;
void
usage(void)
{
- fprint(2, "usage: 9p [-a address] cmd args...\n");
+ fprint(2, "usage: 9p [-a address] [-A aname] cmd args...\n");
fprint(2, "possible cmds:\n");
fprint(2, " read name\n");
fprint(2, " readfd name\n");
@@ -25,6 +25,7 @@ usage(void)
threadexitsall("usage");
}
+char *aname;
void xread(int, char**);
void xwrite(int, char**);
void xreadfd(int, char**);
@@ -53,6 +54,9 @@ threadmain(int argc, char **argv)
int i;
ARGBEGIN{
+ case 'A':
+ aname = EARGF(usage());
+ break;
case 'a':
addr = EARGF(usage());
if(strchr(addr, '!') == nil)
@@ -94,15 +98,15 @@ xparse(char *name, char **path)
else
*p++ = 0;
*path = p;
- fs = nsamount(name, "");
+ fs = nsamount(name, aname);
if(fs == nil)
sysfatal("mount: %r");
}else{
*path = name;
if((fd = dial(addr, nil, nil, nil)) < 0)
sysfatal("dial: %r");
- if((fs = fsamount(fd, "")) == nil)
- sysfatal("fsmount: %r");
+ if((fs = fsamount(fd, aname)) == nil)
+ sysfatal("fsamount: %r");
}
return fs;
}