Skip to content

Commit

Permalink
feat: Adds helptext
Browse files Browse the repository at this point in the history
  • Loading branch information
Nathan Hui committed Sep 12, 2023
1 parent 263381a commit c2cfcd5
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 5 deletions.
12 changes: 12 additions & 0 deletions src/fileCLI/fileCLI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,21 @@ FileCLI::menu_t FileCLI::fsExplorerMenu[] =
{'p', &FileCLI::print_dir},
{'q', &FileCLI::exit},
{'r', &FileCLI::deleteFile},
{'?', &FileCLI::print_help},
{'\0', NULL}
};

void FileCLI::print_help(void)
{
SF_OSAL_printf("%c\t%s" __NL__, 'p', "Print Working Directory");
SF_OSAL_printf("%c\t%s" __NL__, 'l', "List Dir");
SF_OSAL_printf("%c\t%s" __NL__, 'c', "Change Directory");
SF_OSAL_printf("%c\t%s" __NL__, 'r', "Remove File/Directory");
SF_OSAL_printf("%c\t%s" __NL__, 'd', "Base85/64 Dump");
SF_OSAL_printf("%c\t%s" __NL__, 'h', "Hex Dump");
SF_OSAL_printf("%c\t%s" __NL__, 'q', "Quit");
SF_OSAL_printf("%c\t%s" __NL__, '?', "Displays this help text");
}

void FileCLI::execute(void)
{
Expand Down
13 changes: 8 additions & 5 deletions src/fileCLI/fileCLI.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,7 @@ class FileCLI{

protected:
private:
/**
* @brief Duplicates the current file
*
*/
void copyFile(void);

/**
* @brief Dumps the current file to console as base85
*
Expand Down Expand Up @@ -80,6 +76,13 @@ class FileCLI{
*
*/
void print_dir(void);

/**
* @brief Prints the help for the FileCLI
*
*/
void print_help(void);

int run = 1;
DIR* dir_stack[FILE_CLI_MAX_DIR_DEPTH];
char path_stack[FILE_CLI_MAX_DIR_DEPTH][NAME_MAX];
Expand Down

0 comments on commit c2cfcd5

Please sign in to comment.