shithub: gofs

ref: 895af3a6c0ece7ed089ee2a5356cb1933a30cca3
dir: /main.c/

View raw version
#include <u.h>
#include <libc.h>
#include <fcall.h>
#include <thread.h>
#include <9p.h>
#include "dat.h"
#include "fns.h"

Gogame *game1 = nil;

void
usage(void)
{
	fprint(2, "usage: %s [-s srvname]\n", argv0);
	exits("usage");
}

char *srvname = "gofs";
char *mtpt = "/mnt/gofs";

void
main(int argc, char **argv)
{
	Srv *fs;
	
	ARGBEGIN{
	case 's':
		srvname = EARGF(usage());
		break;
	case 'm':
		mtpt = EARGF(usage());
		break;
	}ARGEND;
	
	game1 = newgame(V(19, 19));
	
	fs = getgenfs();
	postmountsrv(fs, srvname, mtpt, MREPL);
	exits(nil);
}