From 1470698024f5511a3b94b7bb50b1097cc6659b32 Mon Sep 17 00:00:00 2001 From: Justin Wind Date: Thu, 24 May 2012 17:45:43 -0700 Subject: [PATCH] added verbosity command to shell --- vm-dcpu16.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/vm-dcpu16.c b/vm-dcpu16.c index cc06b11..aefbcf1 100644 --- a/vm-dcpu16.c +++ b/vm-dcpu16.c @@ -309,6 +309,7 @@ COMMAND_IMPL(reset) { dcpu16_reset(vm); printf("initialized\n"); + return 0; } COMMAND_HELP(reset) { @@ -319,6 +320,27 @@ COMMAND_HELP(reset) { } +COMMAND_IMPL(verbosity) { + int l; + (void)vm, (void)arg_count; + + l = str_to_word(arg_vector[1]); + if (l < 0) { + fprintf(stderr, "invalid level\n"); + return 0; + } + + opt_.verbose = l; + + return 0; +} +COMMAND_HELP(verbosity) { + fprintf(f, "\tverbosity level\n"); + if (summary) return; + + fprintf(f, "sets the verbosity level\n"); +} + COMMAND_IMPL(load) { int addr = 0; @@ -737,6 +759,7 @@ COMMAND_HELP(help); static struct command_ command_table_[] = { COMMAND_ENTRY(help, 0, -1), COMMAND_ENTRY(quit, 0, -1), + COMMAND_ENTRY(verbosity, 1, 1), COMMAND_ENTRY(load, 1, 2), COMMAND_ENTRY(dump, 0, 2), COMMAND_ENTRY(disassemble, 0, 2), -- 2.45.2