Enable -q.

This commit is contained in:
C. Guy Yarvin 2015-05-19 17:04:08 -07:00
parent 1d5aefe142
commit 9bfc5674c3
4 changed files with 16 additions and 5 deletions

View File

@ -23,7 +23,8 @@
u3o_check_corrupt = 0x4, // check: gc memory
u3o_check_fatal = 0x8, // check: unrecoverable
u3o_verbose = 0x10, // be remarkably wordy
u3o_dryrun = 0x20 // don't touch checkpoint
u3o_dryrun = 0x20, // don't touch checkpoint
u3o_quiet = 0x40 // disable ~&
};
/** Globals.

View File

@ -538,6 +538,7 @@
c3_o pro; // -P, profile
c3_o veb; // -v, verbose (inverse of -q)
c3_o nuu; // -c, new pier
c3_o qui; // -q, quiet
c3_o vno; // -V, turn on +verb
c3_o mem; // -M, memory madness
} u3_opts;

8
n/n.c
View File

@ -46,9 +46,11 @@ _n_hint(u3_noun zep,
}
case c3__slog: {
u3t_off(noc_o);
u3t_slog(hod);
u3t_on(noc_o);
if ( !(u3C.wag_w & u3o_quiet) ) {
u3t_off(noc_o);
u3t_slog(hod);
u3t_on(noc_o);
}
return _n_nock_on(bus, nex);
}

View File

@ -74,6 +74,7 @@ _main_getopt(c3_i argc, c3_c** argv)
u3_Host.ops_u.pro = c3n;
u3_Host.ops_u.dry = c3n;
u3_Host.ops_u.veb = c3n;
u3_Host.ops_u.qui = c3n;
u3_Host.ops_u.nuu = c3n;
u3_Host.ops_u.mem = c3n;
u3_Host.ops_u.kno_w = DefaultKernel;
@ -144,7 +145,7 @@ _main_getopt(c3_i argc, c3_c** argv)
case 'g': { u3_Host.ops_u.gab = c3y; break; }
case 'P': { u3_Host.ops_u.pro = c3y; break; }
case 'D': { u3_Host.ops_u.dry = c3y; break; }
case 'q': { u3_Host.ops_u.veb = c3n; break; }
case 'q': { u3_Host.ops_u.qui = c3y; break; }
case 'v': { u3_Host.ops_u.veb = c3y; break; }
case '?': default: {
return c3n;
@ -350,6 +351,12 @@ main(c3_i argc,
if ( _(u3_Host.ops_u.veb) ) {
u3C.wag_w |= u3o_verbose;
}
/* Set quiet flag.
*/
if ( _(u3_Host.ops_u.qui) ) {
u3C.wag_w |= u3o_quiet;
}
/* Set dry-run flag.
*/