]> cloudbase.mooo.com Git - z180-stamp.git/commitdiff
ENV_HOME macro. 'fat help' command table entry
authorLeo C <erbl259-lmu@yahoo.de>
Wed, 4 Apr 2018 19:23:51 +0000 (21:23 +0200)
committerLeo C <erbl259-lmu@yahoo.de>
Wed, 4 Apr 2018 19:23:51 +0000 (21:23 +0200)
avr/cmd_fat.c
include/config.h

index 81ee945ce3969e846c1e0e0057c4e4f358e2a0e5..e09b2a6643fb0d10039a172360867a72f3499d92 100644 (file)
@@ -281,9 +281,9 @@ command_ret_t do_cd(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
        (void) cmdtp; (void) flag; (void) argc;
 
        if (argc < 2) {
-               arg = getenv_str(PSTR("HOME"));
+               arg = getenv_str(PSTR(ENV_HOME));
                if (arg == NULL) {
-                       printf_P(PSTR("%s: \"%S\" is not set\n"), argv[0], PSTR("HOME"));
+                       printf_P(PSTR("%s: \"%S\" is not set\n"), argv[0], PSTR(ENV_HOME));
                        return CMD_RET_FAILURE;
                }
        } else
@@ -579,6 +579,15 @@ CMD_TBL_ITEM(
        "      starting at address 'addr'.\n"
 ),
 
+CMD_TBL_ITEM(
+       help,   CONFIG_SYS_MAXARGS,     1,      do_help,
+       "Print sub command description/usage",
+       "\n"
+       "       - print brief description of all sub commands\n"
+       "fat help command ...\n"
+       "       - print detailed usage of sub cmd 'command'"
+),
+
 /* This does not use the CMD_TBL_ITEM macro as ? can't be used in symbol names */
        {FSTR("?"),   CONFIG_SYS_MAXARGS, 1, do_help,
         FSTR("Alias for 'help'"),
index 2b677093ec5c225a58f13656d1dc946b880ffec1..89f829d84efde37b3fa3da3901afc910ed7423d9 100644 (file)
@@ -25,6 +25,7 @@
 #define ENV_STARTADDRESS               "startaddress"
 #define ENV_ESC_CHAR                   "esc_char"
 
+#define ENV_HOME                               "HOME"
 #define ENV_SINGLESTEP                 "singlestep"
 
 #define CONFIG_ENV_SIZE                        1600