From c2cfcd5c49659707a8d00e26fc4099f49878d58a Mon Sep 17 00:00:00 2001 From: Nathan Hui Date: Tue, 12 Sep 2023 14:57:58 -0700 Subject: [PATCH] feat: Adds helptext --- src/fileCLI/fileCLI.cpp | 12 ++++++++++++ src/fileCLI/fileCLI.hpp | 13 ++++++++----- 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/src/fileCLI/fileCLI.cpp b/src/fileCLI/fileCLI.cpp index 4de491bd..ea290c5b 100644 --- a/src/fileCLI/fileCLI.cpp +++ b/src/fileCLI/fileCLI.cpp @@ -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) { diff --git a/src/fileCLI/fileCLI.hpp b/src/fileCLI/fileCLI.hpp index 602b0f25..df9fc554 100644 --- a/src/fileCLI/fileCLI.hpp +++ b/src/fileCLI/fileCLI.hpp @@ -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 * @@ -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];