]> 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 cd35c8abe7e72ae2ccceb42a8a0fac73f9b3206c..90af1becf7ae82b212f411e5b376bf0f08907211 100644 (file)
@@ -166,7 +166,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;
@@ -175,8 +175,6 @@ command_ret_t do_stat(cmd_tbl_t *cmdtp, uint_fast8_t flag, int argc, char * cons
        char *path = "";
        struct stat_dat_s statp;
 
-       (void) cmdtp; (void) flag; (void) argc;
-
        buf = (char *) malloc(BUFFER_SIZE);
        if (buf == NULL) {
                printf_P(PSTR("fat stat: Out of Memory!\n"));
@@ -745,32 +743,32 @@ command_ret_t do_cp(cmd_tbl_t *cmdtp UNUSED, uint_fast8_t flag UNUSED, int argc,
 
 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"
 ),
 CMD_TBL_ITEM(
-       tst,    2,      CTBL_REPEAT,    do_tst,
+       tst,    2,      CTBL_DBG|CTBL_RPT,      do_tst,
        "FatFS test function",
        "path"
 ),
 CMD_TBL_ITEM(
-       load,   5,      0,      do_rw,
+       load,   5,      0,                      do_rw,
        "load binary file from a dos filesystem",
        "<d:/path/filename> <addr> [bytes [pos]]\n"
        "    - Load binary file 'path/filename' on logical drive 'd'\n"
@@ -781,7 +779,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"
@@ -789,14 +787,14 @@ CMD_TBL_ITEM(
 ),
 
 CMD_TBL_ITEM(
-       cp,     CONFIG_SYS_MAXARGS,     0,      do_cp,
+       cp,     CONFIG_SYS_MAXARGS,     CTBL_DBG,       do_cp,
        "copy files",
-       "cp     [-R] [-f | -i | -n] [-aprv] source_file target_file\n"
+       "[-R] [-f | -i | -n] [-aprv] source_file target_file\n"
        "    - \n"
 ),
 
 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"