summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@localhost>2011-04-16 19:02:03 +0000
committercinap_lenrek <cinap_lenrek@localhost>2011-04-16 19:02:03 +0000
commitf47862d967179880780d63417ecbb150320cc1df (patch)
tree0417f50597601ac5b652210e6ae65ae7a32b1516
parenta95f7282410ebfa4e2a4ff816e8486e7e0f8284a (diff)
allow setting service name from command arguments
-rw-r--r--sys/man/4/cwfs10
-rw-r--r--sys/src/cmd/cwfs/main.c5
2 files changed, 13 insertions, 2 deletions
diff --git a/sys/man/4/cwfs b/sys/man/4/cwfs
index 1cf3518e7..e6a461fdb 100644
--- a/sys/man/4/cwfs
+++ b/sys/man/4/cwfs
@@ -6,6 +6,9 @@ cwfs \- cached-worm file server, dump
[
.B -csC
] [
+.B -n
+.I service
+] [
.B -a
.I announce-string
] ... [
@@ -54,7 +57,7 @@ and its command pipe in
.BI /srv/ name\f1 .cmd,
where
.I name
-is the service name.
+is the service name.
.PP
Options are:
.TP
@@ -91,6 +94,11 @@ thereafter.
enter the file server's configuration mode
before starting normal operation.
.TP
+.B -n
+overrides the
+.I service
+name of the file server's configuration.
+.TP
.B -s
Post file descriptor zero in
.BI /srv/ service
diff --git a/sys/src/cmd/cwfs/main.c b/sys/src/cmd/cwfs/main.c
index 7de53873b..9d12066d0 100644
--- a/sys/src/cmd/cwfs/main.c
+++ b/sys/src/cmd/cwfs/main.c
@@ -279,7 +279,7 @@ printsizes(void)
void
usage(void)
{
- fprint(2, "usage: %s [ -csC ] [ -a ann-str ] [ -m dev-map ] [-f config-dev ]\n", argv0);
+ fprint(2, "usage: %s [ -csC ] [-n service] [ -a ann-str ] [ -m dev-map ] [-f config-dev ]\n", argv0);
exits("usage");
}
@@ -306,6 +306,9 @@ main(int argc, char **argv)
}
annstrs[nets++] = ann;
break;
+ case 'n':
+ strcpy(service, EARGF(usage()));
+ break;
case 's':
sfd = dup(0, -1);
rfd = dup(1, -1);