mirror of
https://github.com/DragonOS-Community/DragonOS.git
synced 2025-06-08 10:15:03 +00:00
* 更改编译器的Include路径,使得include时不需要加`<libc/src/include/>`前缀 * 修改include路径 Co-authored-by: longjin <longjin@RinGoTek.cn>
29 lines
536 B
C
29 lines
536 B
C
#include "cmd_help.h"
|
|
#include <stdio.h>
|
|
#include <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");
|
|
} |