ref: fff686c2f47cc41c09328e9f5bffe5b4a1037281
dir: /main.c/
#include <u.h> #include <libc.h> #include "cuefs.h" char *fname = "<stdin>"; void usage(void) { fprint(2, "usage: %s\n", argv0); exits("usage"); } void main(int argc, char **argv) { ARGBEGIN { default: usage(); } ARGEND; if(argc > 1) usage(); if(argc == 1) { fname = argv[0]; infd = open(fname, OREAD); } cursheet = newsheet(); yyparse(); close(infd); exits(0); }