shell: implement echo command
This commit is contained in:
parent
c6f3e0e421
commit
6dcf58a25d
3 changed files with 19 additions and 0 deletions
1
Makefile
1
Makefile
|
@ -42,6 +42,7 @@ obj-y += source/ftl/map.o
|
|||
|
||||
obj-y += source/shell/args.o
|
||||
obj-y += source/shell/cmd.o
|
||||
obj-y += source/shell/echo.o
|
||||
obj-y += source/shell/flash.o
|
||||
obj-y += source/shell/ftl.o
|
||||
obj-y += source/shell/mufs.o
|
||||
|
|
3
include/shell/echo.h
Normal file
3
include/shell/echo.h
Normal file
|
@ -0,0 +1,3 @@
|
|||
#pragma once
|
||||
|
||||
void shell_echo(struct console *con, const char **argv, size_t argc);
|
15
source/shell/echo.c
Normal file
15
source/shell/echo.c
Normal file
|
@ -0,0 +1,15 @@
|
|||
#include <stdio.h>
|
||||
|
||||
#include <console.h>
|
||||
|
||||
#include <shell/echo.h>
|
||||
|
||||
void shell_echo(struct console *con, const char **argv, size_t argc)
|
||||
{
|
||||
if (argc < 1)
|
||||
return;
|
||||
|
||||
fprintf(con->fp, "%s\n", argv[0]);
|
||||
}
|
||||
|
||||
|
Loading…
Add table
Reference in a new issue