DragonOS/user/apps/shell/cmd_help.c
wwc-15172310230 237e95c6dd
调整user下libs的libc目录结构 (#103)
* 调整user下libs的libc目录结构

* 修正.gitignore文件的问题

* 修复无法编译的问题

Co-authored-by: longjin <longjin@RinGoTek.cn>
2022-12-11 22:22:10 +08:00

28 lines
553 B
C

#include "cmd_help.h"
#include <libc/src/stdio.h>
#include <libc/src/stdlib.h>
struct help_table_item_t
{
void (*func)();
};
struct help_table_item_t help_table[] = {
{shell_help_cd},
};
static const int help_table_num = sizeof(help_table) / sizeof(struct help_table_item_t);
int shell_help(int argc, char **argv)
{
printf("Help:\n");
for (int i = 0; i < help_table_num; ++i)
help_table[i].func();
if (argc > 1)
free(argv);
return 0;
}
void shell_help_cd()
{
printf("Example of cd: cd [destination]\n");
}