aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/namespace.c
blob: ff01450ceca36fa465a0437199241e457be0b299 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#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);
}