Better docs and structure
This commit is contained in:
27
commands.h
27
commands.h
@@ -1,18 +1,35 @@
|
||||
/*
|
||||
* commands.h – Interactive shell command interface.
|
||||
*
|
||||
* Defines the Command structure used by the command registry and the
|
||||
* public API for command execution and help display.
|
||||
*/
|
||||
|
||||
#ifndef COMMANDS_H
|
||||
#define COMMANDS_H
|
||||
|
||||
#include "boot_info.h"
|
||||
|
||||
/* Handler function signature: receives BootInfo and any argument text. */
|
||||
typedef void (*CommandHandlerFn)(BootInfo *Boot, CHAR16 *Args);
|
||||
|
||||
/*
|
||||
* Command – describes a single shell command.
|
||||
*
|
||||
* An array of these (terminated by a sentinel with name == NULL) forms
|
||||
* the command registry in commands.c.
|
||||
*/
|
||||
typedef struct {
|
||||
const CHAR16 *name;
|
||||
const CHAR16 *description;
|
||||
const CHAR16 *usage;
|
||||
CommandHandlerFn handler;
|
||||
const CHAR16 *name; /* command keyword (e.g. L"help") */
|
||||
const CHAR16 *description; /* one-line summary for `help` */
|
||||
const CHAR16 *usage; /* detailed text shown by `man` */
|
||||
CommandHandlerFn handler; /* function that executes the cmd */
|
||||
} Command;
|
||||
|
||||
/* Parse and dispatch a line of user input. */
|
||||
void execute_command(BootInfo *Boot, CHAR16 *Input);
|
||||
|
||||
/* Print a formatted list of all registered commands. */
|
||||
void show_help(BootInfo *Boot);
|
||||
|
||||
#endif
|
||||
#endif /* COMMANDS_H */
|
||||
|
||||
Reference in New Issue
Block a user