+
+/*
+ * command table for fat subcommands
+ */
+
+cmd_tbl_t cmd_tbl_fat[] = {
+CMD_TBL_ITEM(
+ status, 2, CTBL_RPT, do_stat,
+ "Show logical drive status",
+ "dev"
+),
+CMD_TBL_ITEM(
+ pwd, 2, CTBL_RPT|CTBL_SUBCMDAUTO, do_pwd,
+ "Print name of current/working directory",
+ ""
+),
+CMD_TBL_ITEM(
+ cd, 2, 0|CTBL_SUBCMDAUTO, do_cd,
+ "Change the current/working directory.",
+ "path"
+),
+CMD_TBL_ITEM(
+ mkdir, CONFIG_SYS_MAXARGS, 0, do_mkdir,
+ "Create the DIRECTORY(ies), if they do not already exist.",
+ "DIRECTORY..."
+),
+CMD_TBL_ITEM(
+ ls, 2, CTBL_RPT|CTBL_SUBCMDAUTO, do_ls,
+ "Directory listing",
+ "path"
+),
+CMD_TBL_ITEM(
+ tst, 3, CTBL_DBG|CTBL_RPT, do_tst,
+ "FatFS test function",
+ "[path [pattern]]"
+),
+CMD_TBL_ITEM(
+ rm, CONFIG_SYS_MAXARGS, 0, do_rm,
+ "Remove FILE(s) or empty DIRECTORY(ies)",
+ "[OPTION]... [FILE]...\n"
+ //" -i prompt before removal\n"
+ " -n do not remove\n"
+ " -v explain what is being done"
+),
+CMD_TBL_ITEM(
+ cp, CONFIG_SYS_MAXARGS, 0, do_cp,
+ "Copy SOURCE to DEST, or multiple SOURCE(s) to DIRECTORY.",
+ "[OPTION]... SOURCE... DEST\n"
+// " -f overwrite existing file ignoring write protection\n"
+// " this option is ignored when the -n option is also used\n"
+// " -i prompt before overwrite (overrides a previous -n option)\n"
+// " -n do not overwrite an existing file (overrides a previous -i option)\n"
+// " -p preserve attributes and timestamps\n"
+ " -v explain what is being done"
+),
+
+CMD_TBL_ITEM(
+ 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"
+ " to address 'addr' from dos filesystem.\n"
+ " 'pos' gives the file position to start loading from.\n"
+ " If 'pos' is omitted, 0 is used. 'pos' requires 'bytes'.\n"
+ " 'bytes' gives the size to load. If 'bytes' is 0 or omitted,\n"
+ " the load stops on end of file."
+),
+CMD_TBL_ITEM(
+ 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"
+ " starting at address 'addr'.\n"
+),
+
+CMD_TBL_ITEM(
+ help, CONFIG_SYS_MAXARGS, CTBL_RPT, 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,
+ NULL,
+#ifdef CONFIG_SYS_LONGHELP
+ FSTR(""),
+#endif /* CONFIG_SYS_LONGHELP */
+ NULL,
+#ifdef CONFIG_AUTO_COMPLETE
+ NULL,
+#endif
+},
+/* Mark end of table */
+CMD_TBL_END(cmd_tbl_fat)
+};
+
+
+command_ret_t do_fat(cmd_tbl_t *cmdtp UNUSED, uint_fast8_t flag UNUSED, int argc UNUSED, char * const argv[] UNUSED)
+{
+ puts_P(PSTR("Huch?"));
+
+ return CMD_RET_USAGE;
+}