Skip to content

Commit db8c33f

Browse files
committed
Add hello world command into console
Add new command into console.The function is used to exam the process of console and to understand how it works. Change-Id: I4739c940511888107570a4ece748b3a0dac5a135
1 parent d7a3c36 commit db8c33f

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

console.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,11 @@ static bool do_help(int argc, char *argv[])
271271
return true;
272272
}
273273

274+
static bool do_hello(int arg, char *argv[])
275+
{
276+
return (bool) printf("Hello,world\n");
277+
}
278+
274279
static bool do_comment_cmd(int argc, char *argv[])
275280
{
276281
if (echo)
@@ -429,6 +434,7 @@ void init_cmd()
429434
"Display or set options. See 'Options' section for details",
430435
"[name val]");
431436
ADD_COMMAND(quit, "Exit program", "");
437+
ADD_COMMAND(hello, "Print hello message", "");
432438
ADD_COMMAND(source, "Read commands from source file", "file");
433439
ADD_COMMAND(log, "Copy output to file", "file");
434440
ADD_COMMAND(time, "Time command execution", "cmd arg ...");

0 commit comments

Comments
 (0)