diff options
author | rsc <devnull@localhost> | 2004-03-21 14:07:19 +0000 |
---|---|---|
committer | rsc <devnull@localhost> | 2004-03-21 14:07:19 +0000 |
commit | bbbc97b008d49b99cb0f1abdc6aee17a77086326 (patch) | |
tree | 8b484a5d9f67ee3947a3b1a01bf1eba6fe6df0f6 /src/cmd/namespace.c | |
parent | b3f61791f1e9095ce8ae9c6d6415b4ee94e2f7eb (diff) | |
download | plan9port-bbbc97b008d49b99cb0f1abdc6aee17a77086326.tar.gz plan9port-bbbc97b008d49b99cb0f1abdc6aee17a77086326.tar.bz2 plan9port-bbbc97b008d49b99cb0f1abdc6aee17a77086326.zip |
Add namespace.c
Diffstat (limited to 'src/cmd/namespace.c')
-rw-r--r-- | src/cmd/namespace.c | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/src/cmd/namespace.c b/src/cmd/namespace.c new file mode 100644 index 00000000..823e204a --- /dev/null +++ b/src/cmd/namespace.c @@ -0,0 +1,33 @@ +#include <u.h> +#include <libc.h> + +void +usage(void) +{ + fprint(2, "usage: namespace\n"); + exits("usage"); +} + +void +main(int argc, char **argv) +{ + char *ns; + + ARGBEGIN{ + default: + usage(); + }ARGEND + + if(argc) + usage(); + + ns = getns(); + if(ns == nil){ + fprint(2, "namespace: %r\n"); + exits("namespace"); + } + + print("%s\n", ns); + exits(0); +} + |