]> cloudbase.mooo.com Git - z180-stamp.git/blobdiff - avr/cmd_fat.c
Recursive cmd_find(), new command table flag: CTBL_RPT
[z180-stamp.git] / avr / cmd_fat.c
index bb0eca1676026ab70df7382f70a6ac9daecd856e..b083456193a36367ead397853018eff62e4b136d 100644 (file)
@@ -9,11 +9,7 @@
  */
 
 #include "cmd_fat.h"
-#include "common.h"
-#include <string.h>
-#include <stdbool.h>
 
-#include "command.h"
 #include "ff.h"
 #include "z80-if.h"
 #include "eval_arg.h"
@@ -169,7 +165,7 @@ FRESULT scan_files (
  * fatstat path - Show logical drive status
  *
  */
-command_ret_t do_stat(cmd_tbl_t *cmdtp, uint_fast8_t flag, int argc, char * const argv[])
+command_ret_t do_stat(cmd_tbl_t *cmdtp UNUSED, uint_fast8_t flag UNUSED, int argc, char * const argv[])
 {
        FATFS *fs;
        DWORD nfreeclst;
@@ -181,7 +177,7 @@ command_ret_t do_stat(cmd_tbl_t *cmdtp, uint_fast8_t flag, int argc, char * cons
 
        path = (char *) malloc(BUFFER_SIZE);
        if (path == NULL) {
-               printf_P(PSTR("fatstat: Out of Memory!\n"));
+               printf_P(PSTR("fat stat: Out of Memory!\n"));
                free(path);
                return CMD_RET_FAILURE;
        }
@@ -538,22 +534,22 @@ command_ret_t do_rw(cmd_tbl_t *cmdtp, uint_fast8_t flag, int argc, char * const
 
 cmd_tbl_t cmd_tbl_fat[] = {
 CMD_TBL_ITEM(
-       stat,   2,      CTBL_REPEAT,    do_stat,
+       stat,   2,      CTBL_RPT,       do_stat,
        "Show logical drive status",
        "dev"
 ),
 CMD_TBL_ITEM(
-       pwd,    2,      CTBL_REPEAT,    do_pwd,
+       pwd,    2,      CTBL_RPT,       do_pwd,
        "Print name of current/working directory",
        ""
 ),
 CMD_TBL_ITEM(
-       cd,     2,      CTBL_REPEAT,    do_cd,
+       cd,             2,      0,                      do_cd,
        "Change the current/working directory.",
        "path"
 ),
 CMD_TBL_ITEM(
-       ls,     2,      CTBL_REPEAT,    do_ls,
+       ls,             2,      CTBL_RPT,       do_ls,
        "Directory listing",
        "path"
 ),
@@ -569,7 +565,7 @@ CMD_TBL_ITEM(
        "      the load stops on end of file."
 ),
 CMD_TBL_ITEM(
-       write,  4,      0,      do_rw,
+       write,  4,      0,                      do_rw,
        "write file into a dos filesystem",
        "<d:/path/filename> <addr> <bytes>\n"
        "    - Write file to 'path/filename' on logical drive 'd' from RAM\n"
@@ -577,7 +573,7 @@ CMD_TBL_ITEM(
 ),
 
 CMD_TBL_ITEM(
-       help,   CONFIG_SYS_MAXARGS,     CTBL_REPEAT,    do_help,
+       help,   CONFIG_SYS_MAXARGS,     CTBL_RPT,       do_help,
        "Print sub command description/usage",
        "\n"
        "       - print brief description of all sub commands\n"