DragonOS/user/apps/shell/cmd_help.c
fslongjin 85707bd8cc 🆕 cat命令
2022-05-30 17:39:45 +08:00

27 lines
534 B
C

#include "cmd_help.h"
#include <libc/stdio.h>
#include <libc/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);
}
void shell_help_cd()
{
printf("Example of cd: cd [destination]\n");
}