nshlib/command: exclude usage to reduce data size

Test on sim/nsh (CONFIG_NSH_DISABLE_HELP=y):

   text	   data	    bss	    dec	    hex	filename
 393746	  26824	   4000	 424570	  67a7a	nuttx     /* before */
 391858	  26440	   4000	 422298	  6719a	nuttx     /* after */
  -1888    -384

Signed-off-by: chao an <anchao@xiaomi.com>
This commit is contained in:
chao an 2023-06-09 09:34:52 +08:00 committed by Xiang Xiao
parent 4a9b3a5881
commit e4cf94b509

View File

@ -48,6 +48,16 @@
#define HELP_TABSIZE 4 #define HELP_TABSIZE 4
#define NUM_CMDS ((sizeof(g_cmdmap)/sizeof(struct cmdmap_s)) - 1) #define NUM_CMDS ((sizeof(g_cmdmap)/sizeof(struct cmdmap_s)) - 1)
/* Help marco for nsh command */
#ifdef CONFIG_NSH_DISABLE_HELP
# define CMD_MAP(cmd, handler, min, max, usage) \
{ cmd, handler, min, max }
#else
# define CMD_MAP(cmd, handler, min, max, usage) \
{ cmd, handler, min, max, usage }
#endif
/**************************************************************************** /****************************************************************************
* Private Types * Private Types
****************************************************************************/ ****************************************************************************/
@ -58,7 +68,9 @@ struct cmdmap_s
nsh_cmd_t handler; /* Function that handles the command */ nsh_cmd_t handler; /* Function that handles the command */
uint8_t minargs; /* Minimum number of arguments (including command) */ uint8_t minargs; /* Minimum number of arguments (including command) */
uint8_t maxargs; /* Maximum number of arguments (including command) */ uint8_t maxargs; /* Maximum number of arguments (including command) */
#ifndef CONFIG_NSH_DISABLE_HELP
FAR const char *usage; /* Usage instructions for 'help' command */ FAR const char *usage; /* Usage instructions for 'help' command */
#endif
}; };
/**************************************************************************** /****************************************************************************
@ -89,501 +101,509 @@ static int cmd_unrecognized(FAR struct nsh_vtbl_s *vtbl, int argc,
static const struct cmdmap_s g_cmdmap[] = static const struct cmdmap_s g_cmdmap[] =
{ {
#if !defined(CONFIG_NSH_DISABLESCRIPT) && !defined(CONFIG_NSH_DISABLE_SOURCE) #if !defined(CONFIG_NSH_DISABLESCRIPT) && !defined(CONFIG_NSH_DISABLE_SOURCE)
{ ".", cmd_source, 2, 2, "<script-path>" }, CMD_MAP(".", cmd_source, 2, 2, "<script-path>"),
#endif #endif
#if !defined(CONFIG_NSH_DISABLESCRIPT) && !defined(CONFIG_NSH_DISABLE_TEST) #if !defined(CONFIG_NSH_DISABLESCRIPT) && !defined(CONFIG_NSH_DISABLE_TEST)
{ "[", cmd_lbracket, 4, CONFIG_NSH_MAXARGUMENTS, "<expression> ]" }, CMD_MAP("[", cmd_lbracket,
4, CONFIG_NSH_MAXARGUMENTS, "<expression> ]"),
#endif #endif
#ifndef CONFIG_NSH_DISABLE_HELP #ifndef CONFIG_NSH_DISABLE_HELP
{ "?", cmd_help, 1, 1, NULL }, CMD_MAP("?", cmd_help, 1, 1, NULL),
#endif #endif
#if defined(CONFIG_NET) && defined(CONFIG_NET_ROUTE) && !defined(CONFIG_NSH_DISABLE_ADDROUTE) #if defined(CONFIG_NET) && defined(CONFIG_NET_ROUTE) && !defined(CONFIG_NSH_DISABLE_ADDROUTE)
{ "addroute", cmd_addroute, 3, 4, "<target> [<netmask>] <router>" }, CMD_MAP("addroute", cmd_addroute, 3, 4, "<target> [<netmask>] <router>"),
#endif #endif
#ifdef CONFIG_NSH_ALIAS #ifdef CONFIG_NSH_ALIAS
{ "alias", cmd_alias, 1, CONFIG_NSH_MAXARGUMENTS, CMD_MAP("alias", cmd_alias, 1, CONFIG_NSH_MAXARGUMENTS,
"[name[=value] ... ]" }, "[name[=value] ... ]"),
{ "unalias", cmd_unalias, 1, CONFIG_NSH_MAXARGUMENTS, CMD_MAP("unalias", cmd_unalias, 1, CONFIG_NSH_MAXARGUMENTS,
"[-a] name [name ... ]" }, "[-a] name [name ... ]"),
#endif #endif
#if defined(CONFIG_NET) && defined(CONFIG_NET_ARP) && !defined(CONFIG_NSH_DISABLE_ARP) #if defined(CONFIG_NET) && defined(CONFIG_NET_ARP) && !defined(CONFIG_NSH_DISABLE_ARP)
{ "arp", cmd_arp, 1, 6, CMD_MAP("arp", cmd_arp, 1, 6,
"[-i <ifname>] [-a <ipaddr>|-d <ipaddr>|-s <ipaddr> <hwaddr>]" }, "[-i <ifname>] [-a <ipaddr>|-d <ipaddr>|-s <ipaddr> <hwaddr>]"),
#endif #endif
#if defined(CONFIG_NETUTILS_CODECS) && defined(CONFIG_CODECS_BASE64) #if defined(CONFIG_NETUTILS_CODECS) && defined(CONFIG_CODECS_BASE64)
# ifndef CONFIG_NSH_DISABLE_BASE64DEC # ifndef CONFIG_NSH_DISABLE_BASE64DEC
{ "base64dec", cmd_base64decode, 2, 4, "[-w] [-f] <string or filepath>" }, CMD_MAP("base64dec", cmd_base64decode,
2, 4, "[-w] [-f] <string or filepath>"),
# endif # endif
# ifndef CONFIG_NSH_DISABLE_BASE64ENC # ifndef CONFIG_NSH_DISABLE_BASE64ENC
{ "base64enc", cmd_base64encode, 2, 4, "[-w] [-f] <string or filepath>" }, CMD_MAP("base64enc", cmd_base64encode,
2, 4, "[-w] [-f] <string or filepath>"),
# endif # endif
#endif #endif
#ifndef CONFIG_NSH_DISABLE_BASENAME #ifndef CONFIG_NSH_DISABLE_BASENAME
{ "basename", cmd_basename, 2, 3, "<path> [<suffix>]" }, CMD_MAP("basename", cmd_basename, 2, 3, "<path> [<suffix>]"),
#endif #endif
#if defined(CONFIG_BOARDCTL_BOOT_IMAGE) && !defined(CONFIG_NSH_DISABLE_BOOT) #if defined(CONFIG_BOARDCTL_BOOT_IMAGE) && !defined(CONFIG_NSH_DISABLE_BOOT)
{ "boot", cmd_boot, 1, 3, "[<image path> [<header size>]]" }, CMD_MAP("boot", cmd_boot, 1, 3, "[<image path> [<header size>]]"),
#endif #endif
#if !defined(CONFIG_NSH_DISABLESCRIPT) && !defined(CONFIG_NSH_DISABLE_LOOPS) #if !defined(CONFIG_NSH_DISABLESCRIPT) && !defined(CONFIG_NSH_DISABLE_LOOPS)
{ "break", cmd_break, 1, 1, NULL }, CMD_MAP("break", cmd_break, 1, 1, NULL),
#endif #endif
#ifndef CONFIG_NSH_DISABLE_CAT #ifndef CONFIG_NSH_DISABLE_CAT
{ "cat", cmd_cat, 2, CONFIG_NSH_MAXARGUMENTS, CMD_MAP("cat", cmd_cat, 2, CONFIG_NSH_MAXARGUMENTS,
"<path> [<path> [<path> ...]]" }, "<path> [<path> [<path> ...]]"),
#endif #endif
#ifndef CONFIG_DISABLE_ENVIRON #ifndef CONFIG_DISABLE_ENVIRON
# ifndef CONFIG_NSH_DISABLE_CD # ifndef CONFIG_NSH_DISABLE_CD
{ "cd", cmd_cd, 1, 2, "[<dir-path>|-|~|..]" }, CMD_MAP("cd", cmd_cd, 1, 2, "[<dir-path>|-|~|..]"),
# endif # endif
#endif #endif
#ifndef CONFIG_NSH_DISABLE_CP #ifndef CONFIG_NSH_DISABLE_CP
{ "cp", cmd_cp, 3, 3, "<source-path> <dest-path>" }, CMD_MAP("cp", cmd_cp, 3, 3, "<source-path> <dest-path>"),
#endif #endif
#ifndef CONFIG_NSH_DISABLE_CMP #ifndef CONFIG_NSH_DISABLE_CMP
{ "cmp", cmd_cmp, 3, 3, "<path1> <path2>" }, CMD_MAP("cmp", cmd_cmp, 3, 3, "<path1> <path2>"),
#endif #endif
#ifndef CONFIG_NSH_DISABLE_DIRNAME #ifndef CONFIG_NSH_DISABLE_DIRNAME
{ "dirname", cmd_dirname, 2, 2, "<path>" }, CMD_MAP("dirname", cmd_dirname, 2, 2, "<path>"),
#endif #endif
#ifndef CONFIG_NSH_DISABLE_DATE #ifndef CONFIG_NSH_DISABLE_DATE
{ "date", cmd_date, 1, 4, "[-s \"MMM DD HH:MM:SS YYYY\"] [-u]" }, CMD_MAP("date", cmd_date,
1, 4, "[-s \"MMM DD HH:MM:SS YYYY\"] [-u]"),
#endif #endif
#ifndef CONFIG_NSH_DISABLE_DD #ifndef CONFIG_NSH_DISABLE_DD
{ "dd", cmd_dd, 3, 7, CMD_MAP("dd", cmd_dd, 3, 7,
"if=<infile> of=<outfile> [bs=<sectsize>] [count=<sectors>] " "if=<infile> of=<outfile> [bs=<sectsize>] [count=<sectors>] "
"[skip=<sectors>] [verify]" }, "[skip=<sectors>] [verify]"),
#endif #endif
#if defined(CONFIG_NET) && defined(CONFIG_NET_ROUTE) && !defined(CONFIG_NSH_DISABLE_DELROUTE) #if defined(CONFIG_NET) && defined(CONFIG_NET_ROUTE) && !defined(CONFIG_NSH_DISABLE_DELROUTE)
{ "delroute", cmd_delroute, 2, 3, "<target> [<netmask>]" }, CMD_MAP("delroute", cmd_delroute, 2, 3, "<target> [<netmask>]"),
#endif #endif
#if !defined(CONFIG_DISABLE_MOUNTPOINT) && !defined(CONFIG_NSH_DISABLE_DF) #if !defined(CONFIG_DISABLE_MOUNTPOINT) && !defined(CONFIG_NSH_DISABLE_DF)
#ifdef NSH_HAVE_CATFILE #ifdef NSH_HAVE_CATFILE
#if defined(HAVE_DF_HUMANREADBLE) && defined(HAVE_DF_BLOCKOUTPUT) #if defined(HAVE_DF_HUMANREADBLE) && defined(HAVE_DF_BLOCKOUTPUT)
{ "df", cmd_df, 1, 2, "[-h]" }, CMD_MAP("df", cmd_df, 1, 2, "[-h]"),
#else #else
{ "df", cmd_df, 1, 1, NULL }, CMD_MAP("df", cmd_df, 1, 1, NULL),
#endif #endif
#endif #endif
#endif #endif
#if defined(CONFIG_SYSLOG_DEVPATH) && !defined(CONFIG_NSH_DISABLE_DMESG) #if defined(CONFIG_SYSLOG_DEVPATH) && !defined(CONFIG_NSH_DISABLE_DMESG)
{ "dmesg", cmd_dmesg, 1, 1, NULL }, CMD_MAP("dmesg", cmd_dmesg, 1, 1, NULL),
#endif #endif
#ifndef CONFIG_NSH_DISABLE_ECHO #ifndef CONFIG_NSH_DISABLE_ECHO
# ifndef CONFIG_DISABLE_ENVIRON # ifndef CONFIG_DISABLE_ENVIRON
{ "echo", cmd_echo, 1, CONFIG_NSH_MAXARGUMENTS, CMD_MAP("echo", cmd_echo, 1, CONFIG_NSH_MAXARGUMENTS,
"[-n] [<string|$name> [<string|$name>...]]" }, "[-n] [<string|$name> [<string|$name>...]]"),
# else # else
{ "echo", cmd_echo, 1, CONFIG_NSH_MAXARGUMENTS, CMD_MAP("echo", cmd_echo, 1, CONFIG_NSH_MAXARGUMENTS,
"[-n] [<string> [<string>...]]" }, "[-n] [<string> [<string>...]]"),
# endif # endif
#endif #endif
#ifndef CONFIG_NSH_DISABLE_ENV #ifndef CONFIG_NSH_DISABLE_ENV
{ "env", cmd_env, 1, 1, NULL }, CMD_MAP("env", cmd_env, 1, 1, NULL),
#endif #endif
#ifndef CONFIG_NSH_DISABLE_EXEC #ifndef CONFIG_NSH_DISABLE_EXEC
{ "exec", cmd_exec, 2, 3, "<hex-address>" }, CMD_MAP("exec", cmd_exec, 2, 3, "<hex-address>"),
#endif #endif
#ifndef CONFIG_NSH_DISABLE_EXIT #ifndef CONFIG_NSH_DISABLE_EXIT
{ "exit", cmd_exit, 1, 1, NULL }, CMD_MAP("exit", cmd_exit, 1, 1, NULL),
#endif #endif
#ifndef CONFIG_NSH_DISABLE_EXPORT #ifndef CONFIG_NSH_DISABLE_EXPORT
{ "export", cmd_export, 2, 3, "[<name> [<value>]]" }, CMD_MAP("export", cmd_export, 2, 3, "[<name> [<value>]]"),
#endif #endif
#ifndef CONFIG_NSH_DISABLESCRIPT #ifndef CONFIG_NSH_DISABLESCRIPT
{ "false", cmd_false, 1, 1, NULL }, CMD_MAP("false", cmd_false, 1, 1, NULL),
#endif #endif
#ifndef CONFIG_NSH_DISABLE_FREE #ifndef CONFIG_NSH_DISABLE_FREE
{ "free", cmd_free, 1, 1, NULL }, CMD_MAP("free", cmd_free, 1, 1, NULL),
#endif #endif
#ifdef CONFIG_DEBUG_MM #ifdef CONFIG_DEBUG_MM
# ifndef CONFIG_NSH_DISABLE_MEMDUMP # ifndef CONFIG_NSH_DISABLE_MEMDUMP
{ "memdump", cmd_memdump, 1, 4, "[pid/used/free/on/off]" CMD_MAP("memdump", cmd_memdump,
" <minseq> <maxseq>"}, 1, 4, "[pid/used/free/on/off]" " <minseq> <maxseq>"),
# endif # endif
#endif #endif
#ifdef CONFIG_NET_UDP #ifdef CONFIG_NET_UDP
# ifndef CONFIG_NSH_DISABLE_GET # ifndef CONFIG_NSH_DISABLE_GET
{ "get", cmd_get, 4, 7, CMD_MAP("get", cmd_get, 4, 7,
"[-b|-n] [-f <local-path>] -h <ip-address> <remote-path>" }, "[-b|-n] [-f <local-path>] -h <ip-address> <remote-path>"),
# endif # endif
#endif #endif
#ifndef CONFIG_NSH_DISABLE_HELP #ifndef CONFIG_NSH_DISABLE_HELP
# ifdef CONFIG_NSH_HELP_TERSE # ifdef CONFIG_NSH_HELP_TERSE
{ "help", cmd_help, 1, 2, "[<cmd>]" }, CMD_MAP("help", cmd_help, 1, 2, "[<cmd>]"),
# else # else
{ "help", cmd_help, 1, 3, "[-v] [<cmd>]" }, CMD_MAP("help", cmd_help, 1, 3, "[-v] [<cmd>]"),
# endif # endif
#endif #endif
#ifndef CONFIG_NSH_DISABLE_HEXDUMP #ifndef CONFIG_NSH_DISABLE_HEXDUMP
#ifndef CONFIG_NSH_CMDOPT_HEXDUMP #ifndef CONFIG_NSH_CMDOPT_HEXDUMP
{ "hexdump", cmd_hexdump, 2, 2, "<file or device>" }, CMD_MAP("hexdump", cmd_hexdump, 2, 2, "<file or device>"),
#else #else
{ "hexdump", cmd_hexdump, 2, 4, CMD_MAP("hexdump", cmd_hexdump, 2, 4,
"<file or device> [skip=<bytes>] [count=<bytes>]" }, "<file or device> [skip=<bytes>] [count=<bytes>]"),
#endif #endif
#endif #endif
#ifdef CONFIG_NET #ifdef CONFIG_NET
# ifndef CONFIG_NSH_DISABLE_IFCONFIG # ifndef CONFIG_NSH_DISABLE_IFCONFIG
{ "ifconfig", cmd_ifconfig, 1, 12, CMD_MAP("ifconfig", cmd_ifconfig, 1, 12,
"[interface [address_family] [mtu <len>] | [<ip-address>|dhcp]]" "[interface [address_family] [mtu <len>] | [<ip-address>|dhcp]]"
"[dr|gw|gateway <dr-address>] [netmask <net-mask>|prefixlen <len>] " "[dr|gw|gateway <dr-address>] [netmask <net-mask>|prefixlen <len>] "
"[dns <dns-address>] [hw <hw-mac>]" }, "[dns <dns-address>] [hw <hw-mac>]"),
# endif # endif
# ifndef CONFIG_NSH_DISABLE_IFUPDOWN # ifndef CONFIG_NSH_DISABLE_IFUPDOWN
{ "ifdown", cmd_ifdown, 2, 2, "<interface>" }, CMD_MAP("ifdown", cmd_ifdown, 2, 2, "<interface>"),
{ "ifup", cmd_ifup, 2, 2, "<interface>" }, CMD_MAP("ifup", cmd_ifup, 2, 2, "<interface>"),
# endif # endif
#endif #endif
#if defined(CONFIG_MODULE) && !defined(CONFIG_NSH_DISABLE_MODCMDS) #if defined(CONFIG_MODULE) && !defined(CONFIG_NSH_DISABLE_MODCMDS)
{ "insmod", cmd_insmod, 3, 3, "<file-path> <module-name>" }, CMD_MAP("insmod", cmd_insmod, 3, 3, "<file-path> <module-name>"),
#endif #endif
#ifdef HAVE_IRQINFO #ifdef HAVE_IRQINFO
{ "irqinfo", cmd_irqinfo, 1, 1, NULL }, CMD_MAP("irqinfo", cmd_irqinfo, 1, 1, NULL),
#endif #endif
#ifndef CONFIG_NSH_DISABLE_KILL #ifndef CONFIG_NSH_DISABLE_KILL
{ "kill", cmd_kill, 2, 3, "[-<signal>] <pid>" }, CMD_MAP("kill", cmd_kill, 2, 3, "[-<signal>] <pid>"),
#endif #endif
#ifndef CONFIG_DISABLE_MOUNTPOINT #ifndef CONFIG_DISABLE_MOUNTPOINT
# if defined(CONFIG_DEV_LOOP) && !defined(CONFIG_NSH_DISABLE_LOSETUP) # if defined(CONFIG_DEV_LOOP) && !defined(CONFIG_NSH_DISABLE_LOSETUP)
{ "losetup", cmd_losetup, 3, 6, CMD_MAP("losetup", cmd_losetup, 3, 6,
"[-d <dev-path>] | [[-o <offset>] [-r] [-s <sect-size>] " "[-d <dev-path>] | [[-o <offset>] [-r] [-s <sect-size>] "
"<dev-path> <file-path>]" }, "<dev-path> <file-path>]"),
# endif # endif
#endif #endif
#ifndef CONFIG_DISABLE_MOUNTPOINT #ifndef CONFIG_DISABLE_MOUNTPOINT
# if defined(CONFIG_SMART_DEV_LOOP) && !defined(CONFIG_NSH_DISABLE_LOSMART) # if defined(CONFIG_SMART_DEV_LOOP) && !defined(CONFIG_NSH_DISABLE_LOSMART)
{ "losmart", cmd_losmart, 2, 11, CMD_MAP("losmart", cmd_losmart, 2, 11,
"[-d <dev-path>] | [[-m <minor>] [-o <offset>] [-e <erase-size>] " "[-d <dev-path>] | [[-m <minor>] [-o <offset>] [-e <erase-size>] "
"[-s <sect-size>] [-r] <file-path>]" }, "[-s <sect-size>] [-r] <file-path>]"),
# endif # endif
#endif #endif
#ifndef CONFIG_DISABLE_MOUNTPOINT #ifndef CONFIG_DISABLE_MOUNTPOINT
# if defined(CONFIG_MTD_LOOP) && !defined(CONFIG_NSH_DISABLE_LOMTD) # if defined(CONFIG_MTD_LOOP) && !defined(CONFIG_NSH_DISABLE_LOMTD)
{ "lomtd", cmd_lomtd, 3, 9, CMD_MAP("lomtd", cmd_lomtd, 3, 9,
"[-d <dev-path>] | [[-o <offset>] [-e <erase-size>] " "[-d <dev-path>] | [[-o <offset>] [-e <erase-size>] "
"[-s <sect-size>] <dev-path> <file-path>]]" }, "[-s <sect-size>] <dev-path> <file-path>]]"),
# endif # endif
#endif #endif
#if !defined(CONFIG_NSH_DISABLE_LN) && defined(CONFIG_PSEUDOFS_SOFTLINKS) #if !defined(CONFIG_NSH_DISABLE_LN) && defined(CONFIG_PSEUDOFS_SOFTLINKS)
{ "ln", cmd_ln, 3, 4, "[-s] <target> <link>" }, CMD_MAP("ln", cmd_ln, 3, 4, "[-s] <target> <link>"),
#endif #endif
#ifndef CONFIG_NSH_DISABLE_LS #ifndef CONFIG_NSH_DISABLE_LS
{ "ls", cmd_ls, 1, 5, "[-lRs] <dir-path>" }, CMD_MAP("ls", cmd_ls, 1, 5, "[-lRs] <dir-path>"),
#endif #endif
#if defined(CONFIG_MODULE) && !defined(CONFIG_NSH_DISABLE_MODCMDS) #if defined(CONFIG_MODULE) && !defined(CONFIG_NSH_DISABLE_MODCMDS)
# if defined(CONFIG_FS_PROCFS) && !defined(CONFIG_FS_PROCFS_EXCLUDE_MODULE) # if defined(CONFIG_FS_PROCFS) && !defined(CONFIG_FS_PROCFS_EXCLUDE_MODULE)
{ "lsmod", cmd_lsmod, 1, 1, NULL }, CMD_MAP("lsmod", cmd_lsmod, 1, 1, NULL),
# endif # endif
#endif #endif
#ifndef CONFIG_NSH_DISABLE_MB #ifndef CONFIG_NSH_DISABLE_MB
{ "mb", cmd_mb, 2, 3, CMD_MAP("mb", cmd_mb, 2, 3,
"<hex-address>[=<hex-value>] [<hex-byte-count>]" }, "<hex-address>[=<hex-value>] [<hex-byte-count>]"),
#endif #endif
#if defined(CONFIG_NETUTILS_CODECS) && defined(CONFIG_CODECS_HASH_MD5) #if defined(CONFIG_NETUTILS_CODECS) && defined(CONFIG_CODECS_HASH_MD5)
# ifndef CONFIG_NSH_DISABLE_MD5 # ifndef CONFIG_NSH_DISABLE_MD5
{ "md5", cmd_md5, 2, 3, "[-f] <string or filepath>" }, CMD_MAP("md5", cmd_md5, 2, 3, "[-f] <string or filepath>"),
# endif # endif
#endif #endif
#ifdef NSH_HAVE_DIROPTS #ifdef NSH_HAVE_DIROPTS
# ifndef CONFIG_NSH_DISABLE_MKDIR # ifndef CONFIG_NSH_DISABLE_MKDIR
{ "mkdir", cmd_mkdir, 2, 3, "[-p] <path>" }, CMD_MAP("mkdir", cmd_mkdir, 2, 3, "[-p] <path>"),
# endif # endif
#endif #endif
#if !defined(CONFIG_DISABLE_MOUNTPOINT) && defined(CONFIG_FSUTILS_MKFATFS) #if !defined(CONFIG_DISABLE_MOUNTPOINT) && defined(CONFIG_FSUTILS_MKFATFS)
# ifndef CONFIG_NSH_DISABLE_MKFATFS # ifndef CONFIG_NSH_DISABLE_MKFATFS
{ "mkfatfs", cmd_mkfatfs, 2, 6, CMD_MAP("mkfatfs", cmd_mkfatfs, 2, 6,
"[-F <fatsize>] [-r <rootdirentries>] <block-driver>" }, "[-F <fatsize>] [-r <rootdirentries>] <block-driver>"),
# endif # endif
#endif #endif
#ifndef CONFIG_DISABLE_MOUNTPOINT #ifndef CONFIG_DISABLE_MOUNTPOINT
# if defined(CONFIG_PIPES) && CONFIG_DEV_FIFO_SIZE > 0 && \ # if defined(CONFIG_PIPES) && CONFIG_DEV_FIFO_SIZE > 0 && \
!defined(CONFIG_NSH_DISABLE_MKFIFO) !defined(CONFIG_NSH_DISABLE_MKFIFO)
{ "mkfifo", cmd_mkfifo, 2, 2, "<path>" }, CMD_MAP("mkfifo", cmd_mkfifo, 2, 2, "<path>"),
# endif # endif
#endif #endif
#ifndef CONFIG_NSH_DISABLE_MKRD #ifndef CONFIG_NSH_DISABLE_MKRD
{ "mkrd", cmd_mkrd, 2, 6, CMD_MAP("mkrd", cmd_mkrd, 2, 6,
"[-m <minor>] [-s <sector-size>] <nsectors>" }, "[-m <minor>] [-s <sector-size>] <nsectors>"),
#endif #endif
#if !defined(CONFIG_DISABLE_MOUNTPOINT) && defined(CONFIG_FS_SMARTFS) && \ #if !defined(CONFIG_DISABLE_MOUNTPOINT) && defined(CONFIG_FS_SMARTFS) && \
defined(CONFIG_FSUTILS_MKSMARTFS) defined(CONFIG_FSUTILS_MKSMARTFS)
# ifndef CONFIG_NSH_DISABLE_MKSMARTFS # ifndef CONFIG_NSH_DISABLE_MKSMARTFS
# ifdef CONFIG_SMARTFS_MULTI_ROOT_DIRS # ifdef CONFIG_SMARTFS_MULTI_ROOT_DIRS
{ "mksmartfs", cmd_mksmartfs, 2, 6, CMD_MAP("mksmartfs", cmd_mksmartfs, 2, 6,
"[-s <sector-size>] [-f] <path> [<num-root-directories>]" }, "[-s <sector-size>] [-f] <path> [<num-root-directories>]"),
# else # else
{ "mksmartfs", cmd_mksmartfs, 2, 5, "[-s <sector-size>] [-f] <path>" }, CMD_MAP("mksmartfs", cmd_mksmartfs,
2, 5, "[-s <sector-size>] [-f] <path>"),
# endif # endif
# endif # endif
#endif #endif
#ifndef CONFIG_NSH_DISABLE_MH #ifndef CONFIG_NSH_DISABLE_MH
{ "mh", cmd_mh, 2, 3, CMD_MAP("mh", cmd_mh, 2, 3,
"<hex-address>[=<hex-value>] [<hex-byte-count>]" }, "<hex-address>[=<hex-value>] [<hex-byte-count>]"),
#endif #endif
#if !defined(CONFIG_DISABLE_MOUNTPOINT) #if !defined(CONFIG_DISABLE_MOUNTPOINT)
# ifndef CONFIG_NSH_DISABLE_MOUNT # ifndef CONFIG_NSH_DISABLE_MOUNT
# if defined(NSH_HAVE_CATFILE) && defined(HAVE_MOUNT_LIST) # if defined(NSH_HAVE_CATFILE) && defined(HAVE_MOUNT_LIST)
{ "mount", cmd_mount, 1, 7, CMD_MAP("mount", cmd_mount, 1, 7,
"[-t <fstype> [-o <options>] [<block-device>] <mount-point>]" }, "[-t <fstype> [-o <options>] [<block-device>] <mount-point>]"),
# else # else
{ "mount", cmd_mount, 4, 7, CMD_MAP("mount", cmd_mount, 4, 7,
"-t <fstype> [-o <options>] [<block-device>] <mount-point>" }, "-t <fstype> [-o <options>] [<block-device>] <mount-point>"),
# endif # endif
# endif # endif
#endif #endif
#ifdef NSH_HAVE_DIROPTS #ifdef NSH_HAVE_DIROPTS
# ifndef CONFIG_NSH_DISABLE_MV # ifndef CONFIG_NSH_DISABLE_MV
{ "mv", cmd_mv, 3, 3, "<old-path> <new-path>" }, CMD_MAP("mv", cmd_mv, 3, 3, "<old-path> <new-path>"),
# endif # endif
#endif #endif
#ifndef CONFIG_NSH_DISABLE_MW #ifndef CONFIG_NSH_DISABLE_MW
{ "mw", cmd_mw, 2, 3, CMD_MAP("mw", cmd_mw, 2, 3,
"<hex-address>[=<hex-value>] [<hex-byte-count>]" }, "<hex-address>[=<hex-value>] [<hex-byte-count>]"),
#endif #endif
#if !defined(CONFIG_DISABLE_MOUNTPOINT) && defined(CONFIG_NET) && \ #if !defined(CONFIG_DISABLE_MOUNTPOINT) && defined(CONFIG_NET) && \
defined(CONFIG_NFS) defined(CONFIG_NFS)
# ifndef CONFIG_NSH_DISABLE_NFSMOUNT # ifndef CONFIG_NSH_DISABLE_NFSMOUNT
{ "nfsmount", cmd_nfsmount, 4, 5, CMD_MAP("nfsmount", cmd_nfsmount, 4, 5,
"<server-address> <mount-point> <remote-path> [udp]" }, "<server-address> <mount-point> <remote-path> [udp]"),
# endif # endif
#endif #endif
#if defined(CONFIG_LIBC_NETDB) && !defined(CONFIG_NSH_DISABLE_NSLOOKUP) #if defined(CONFIG_LIBC_NETDB) && !defined(CONFIG_NSH_DISABLE_NSLOOKUP)
{ "nslookup", cmd_nslookup, 2, 2, "<host-name>" }, CMD_MAP("nslookup", cmd_nslookup, 2, 2, "<host-name>"),
#endif #endif
#if !defined(CONFIG_DISABLE_MOUNTPOINT) && \ #if !defined(CONFIG_DISABLE_MOUNTPOINT) && \
defined(CONFIG_NSH_LOGIN_PASSWD) && \ defined(CONFIG_NSH_LOGIN_PASSWD) && \
!defined(CONFIG_FSUTILS_PASSWD_READONLY) !defined(CONFIG_FSUTILS_PASSWD_READONLY)
# ifndef CONFIG_NSH_DISABLE_PASSWD # ifndef CONFIG_NSH_DISABLE_PASSWD
{ "passwd", cmd_passwd, 3, 3, "<username> <password>" }, CMD_MAP("passwd", cmd_passwd, 3, 3, "<username> <password>"),
# endif # endif
#endif #endif
#if defined(CONFIG_PM) && !defined(CONFIG_NSH_DISABLE_PMCONFIG) #if defined(CONFIG_PM) && !defined(CONFIG_NSH_DISABLE_PMCONFIG)
{ "pmconfig", cmd_pmconfig, 1, 4, CMD_MAP("pmconfig", cmd_pmconfig, 1, 4,
"[stay|relax] [normal|idle|standby|sleep] [domain]" }, "[stay|relax] [normal|idle|standby|sleep] [domain]"),
#endif #endif
#if defined(CONFIG_BOARDCTL_POWEROFF) && !defined(CONFIG_NSH_DISABLE_POWEROFF) #if defined(CONFIG_BOARDCTL_POWEROFF) && !defined(CONFIG_NSH_DISABLE_POWEROFF)
{ "poweroff", cmd_poweroff, 1, 2, NULL }, CMD_MAP("poweroff", cmd_poweroff, 1, 2, NULL),
#endif #endif
#ifndef CONFIG_NSH_DISABLE_PRINTF #ifndef CONFIG_NSH_DISABLE_PRINTF
# ifndef CONFIG_DISABLE_ENVIRON # ifndef CONFIG_DISABLE_ENVIRON
{ "printf", cmd_printf, 1, CONFIG_NSH_MAXARGUMENTS, CMD_MAP("printf", cmd_printf, 1, CONFIG_NSH_MAXARGUMENTS,
"[\\xNN] [\\n\\r\\t] [<string|$name> [<string|$name>...]]" }, "[\\xNN] [\\n\\r\\t] [<string|$name> [<string|$name>...]]"),
# else # else
{ "printf", cmd_printf, 1, CONFIG_NSH_MAXARGUMENTS, CMD_MAP("printf", cmd_printf, 1, CONFIG_NSH_MAXARGUMENTS,
"[\\xNN] [\\n\\r\\t] [<string> [<string>...]]" }, "[\\xNN] [\\n\\r\\t] [<string> [<string>...]]"),
# endif # endif
#endif #endif
#ifndef CONFIG_NSH_DISABLE_PS #ifndef CONFIG_NSH_DISABLE_PS
{ "ps", cmd_ps, 1, 1, NULL }, CMD_MAP("ps", cmd_ps, 1, 1, NULL),
#endif #endif
#ifdef CONFIG_NET_UDP #ifdef CONFIG_NET_UDP
# ifndef CONFIG_NSH_DISABLE_PUT # ifndef CONFIG_NSH_DISABLE_PUT
{ "put", cmd_put, 4, 7, CMD_MAP("put", cmd_put, 4, 7,
"[-b|-n] [-f <remote-path>] -h <ip-address> <local-path>" }, "[-b|-n] [-f <remote-path>] -h <ip-address> <local-path>"),
# endif # endif
#endif #endif
#ifndef CONFIG_DISABLE_ENVIRON #ifndef CONFIG_DISABLE_ENVIRON
# ifndef CONFIG_NSH_DISABLE_PWD # ifndef CONFIG_NSH_DISABLE_PWD
{ "pwd", cmd_pwd, 1, 1, NULL }, CMD_MAP("pwd", cmd_pwd, 1, 1, NULL),
# endif # endif
#endif #endif
#if !defined(CONFIG_NSH_DISABLE_READLINK) && defined(CONFIG_PSEUDOFS_SOFTLINKS) #if !defined(CONFIG_NSH_DISABLE_READLINK) && defined(CONFIG_PSEUDOFS_SOFTLINKS)
{ "readlink", cmd_readlink, 2, 2, "<link>" }, CMD_MAP("readlink", cmd_readlink, 2, 2, "<link>"),
#endif #endif
#if defined(CONFIG_BOARDCTL_RESET) && !defined(CONFIG_NSH_DISABLE_REBOOT) #if defined(CONFIG_BOARDCTL_RESET) && !defined(CONFIG_NSH_DISABLE_REBOOT)
{ "reboot", cmd_reboot, 1, 2, NULL }, CMD_MAP("reboot", cmd_reboot, 1, 2, NULL),
#endif #endif
#if defined(CONFIG_BOARDCTL_RESET_CAUSE) && !defined(CONFIG_NSH_DISABLE_RESET_CAUSE) #if defined(CONFIG_BOARDCTL_RESET_CAUSE) && !defined(CONFIG_NSH_DISABLE_RESET_CAUSE)
{ "resetcause", cmd_reset_cause, 1, 1, NULL }, CMD_MAP("resetcause", cmd_reset_cause, 1, 1, NULL),
#endif #endif
#ifdef NSH_HAVE_DIROPTS #ifdef NSH_HAVE_DIROPTS
# ifndef CONFIG_NSH_DISABLE_RM # ifndef CONFIG_NSH_DISABLE_RM
{ "rm", cmd_rm, 2, 3, "[-r] <file-path>" }, CMD_MAP("rm", cmd_rm, 2, 3, "[-r] <file-path>"),
# endif # endif
#endif #endif
#ifdef NSH_HAVE_DIROPTS #ifdef NSH_HAVE_DIROPTS
# ifndef CONFIG_NSH_DISABLE_RMDIR # ifndef CONFIG_NSH_DISABLE_RMDIR
{ "rmdir", cmd_rmdir, 2, 2, "<dir-path>" }, CMD_MAP("rmdir", cmd_rmdir, 2, 2, "<dir-path>"),
# endif # endif
#endif #endif
#if defined(CONFIG_MODULE) && !defined(CONFIG_NSH_DISABLE_MODCMDS) #if defined(CONFIG_MODULE) && !defined(CONFIG_NSH_DISABLE_MODCMDS)
{ "rmmod", cmd_rmmod, 2, 2, "<module-name>" }, CMD_MAP("rmmod", cmd_rmmod, 2, 2, "<module-name>"),
#endif #endif
#ifndef CONFIG_NSH_DISABLE_ROUTE #ifndef CONFIG_NSH_DISABLE_ROUTE
#if defined(CONFIG_NET_IPv4) && defined(CONFIG_NET_IPv6) #if defined(CONFIG_NET_IPv4) && defined(CONFIG_NET_IPv6)
{ "route", cmd_route, 2, 2, "ipv4|ipv6" }, CMD_MAP("route", cmd_route, 2, 2, "ipv4|ipv6"),
#elif defined(CONFIG_NET_IPv4) #elif defined(CONFIG_NET_IPv4)
{ "route", cmd_route, 1, 2, "[ipv4]" }, CMD_MAP("route", cmd_route, 1, 2, "[ipv4]"),
#elif defined(CONFIG_NET_IPv6) #elif defined(CONFIG_NET_IPv6)
{ "route", cmd_route, 1, 2, "[ipv6]" }, CMD_MAP("route", cmd_route, 1, 2, "[ipv6]"),
#endif #endif
#endif #endif
#if defined(CONFIG_RPTUN) && !defined(CONFIG_NSH_DISABLE_RPTUN) #if defined(CONFIG_RPTUN) && !defined(CONFIG_NSH_DISABLE_RPTUN)
{ "rptun", cmd_rptun, 3, 7, CMD_MAP("rptun", cmd_rptun, 3, 7,
"<start|stop|reset|panic|dump|ping> <path|all>" "<start|stop|reset|panic|dump|ping> <path|all>"
" [value|times length ack sleep]" }, " [value|times length ack sleep]"),
#endif #endif
#ifndef CONFIG_NSH_DISABLE_SET #ifndef CONFIG_NSH_DISABLE_SET
#ifdef CONFIG_NSH_VARS #ifdef CONFIG_NSH_VARS
# if !defined(CONFIG_DISABLE_ENVIRON) && !defined(CONFIG_NSH_DISABLESCRIPT) # if !defined(CONFIG_DISABLE_ENVIRON) && !defined(CONFIG_NSH_DISABLESCRIPT)
{ "set", cmd_set, 1, 4, "[{+|-}{e|x|xe|ex}] [<name> <value>]" }, CMD_MAP("set", cmd_set,
1, 4, "[{+|-}{e|x|xe|ex}] [<name> <value>]"),
# elif !defined(CONFIG_DISABLE_ENVIRON) && defined(CONFIG_NSH_DISABLESCRIPT) # elif !defined(CONFIG_DISABLE_ENVIRON) && defined(CONFIG_NSH_DISABLESCRIPT)
{ "set", cmd_set, 1, 3, "[<name> <value>]" }, CMD_MAP("set", cmd_set, 1, 3, "[<name> <value>]"),
# elif defined(CONFIG_DISABLE_ENVIRON) && !defined(CONFIG_NSH_DISABLESCRIPT) # elif defined(CONFIG_DISABLE_ENVIRON) && !defined(CONFIG_NSH_DISABLESCRIPT)
{ "set", cmd_set, 1, 2, "[{+|-}{e|x|xe|ex}]" }, CMD_MAP("set", cmd_set, 1, 2, "[{+|-}{e|x|xe|ex}]"),
# endif # endif
#else #else
# if !defined(CONFIG_DISABLE_ENVIRON) && !defined(CONFIG_NSH_DISABLESCRIPT) # if !defined(CONFIG_DISABLE_ENVIRON) && !defined(CONFIG_NSH_DISABLESCRIPT)
{ "set", cmd_set, 2, 4, "[{+|-}{e|x|xe|ex}] [<name> <value>]" }, CMD_MAP("set", cmd_set,
2, 4, "[{+|-}{e|x|xe|ex}] [<name> <value>]"),
# elif !defined(CONFIG_DISABLE_ENVIRON) && defined(CONFIG_NSH_DISABLESCRIPT) # elif !defined(CONFIG_DISABLE_ENVIRON) && defined(CONFIG_NSH_DISABLESCRIPT)
{ "set", cmd_set, 3, 3, "<name> <value>" }, CMD_MAP("set", cmd_set, 3, 3, "<name> <value>"),
# elif defined(CONFIG_DISABLE_ENVIRON) && !defined(CONFIG_NSH_DISABLESCRIPT) # elif defined(CONFIG_DISABLE_ENVIRON) && !defined(CONFIG_NSH_DISABLESCRIPT)
{ "set", cmd_set, 2, 2, "{+|-}{e|x|xe|ex}" }, CMD_MAP("set", cmd_set, 2, 2, "{+|-}{e|x|xe|ex}"),
# endif # endif
#endif #endif
#endif /* CONFIG_NSH_DISABLE_SET */ #endif /* CONFIG_NSH_DISABLE_SET */
#ifndef CONFIG_NSH_DISABLE_SHUTDOWN #ifndef CONFIG_NSH_DISABLE_SHUTDOWN
#if defined(CONFIG_BOARDCTL_POWEROFF) && defined(CONFIG_BOARDCTL_RESET) #if defined(CONFIG_BOARDCTL_POWEROFF) && defined(CONFIG_BOARDCTL_RESET)
{ "shutdown", cmd_shutdown, 1, 2, "[--reboot]" }, CMD_MAP("shutdown", cmd_shutdown, 1, 2, "[--reboot]"),
#elif defined(CONFIG_BOARDCTL_POWEROFF) #elif defined(CONFIG_BOARDCTL_POWEROFF)
{ "shutdown", cmd_shutdown, 1, 1, NULL }, CMD_MAP("shutdown", cmd_shutdown, 1, 1, NULL),
#elif defined(CONFIG_BOARDCTL_RESET) #elif defined(CONFIG_BOARDCTL_RESET)
{ "shutdown", cmd_shutdown, 2, 2, "--reboot" }, CMD_MAP("shutdown", cmd_shutdown, 2, 2, "--reboot"),
#endif #endif
#endif #endif
#ifndef CONFIG_NSH_DISABLE_SLEEP #ifndef CONFIG_NSH_DISABLE_SLEEP
{ "sleep", cmd_sleep, 2, 2, "<sec>" }, CMD_MAP("sleep", cmd_sleep, 2, 2, "<sec>"),
#endif #endif
#if !defined(CONFIG_NSH_DISABLESCRIPT) && !defined(CONFIG_NSH_DISABLE_SOURCE) #if !defined(CONFIG_NSH_DISABLESCRIPT) && !defined(CONFIG_NSH_DISABLE_SOURCE)
{ "source", cmd_source, 2, 2, "<script-path>" }, CMD_MAP("source", cmd_source, 2, 2, "<script-path>"),
#endif #endif
#if defined(CONFIG_BOARDCTL_SWITCH_BOOT) && !defined(CONFIG_NSH_DISABLE_SWITCHBOOT) #if defined(CONFIG_BOARDCTL_SWITCH_BOOT) && !defined(CONFIG_NSH_DISABLE_SWITCHBOOT)
{ "swtichboot", cmd_switchboot, 2, 2, "<image path>" }, CMD_MAP("swtichboot", cmd_switchboot, 2, 2, "<image path>"),
#endif #endif
#if !defined(CONFIG_NSH_DISABLESCRIPT) && !defined(CONFIG_NSH_DISABLE_TEST) #if !defined(CONFIG_NSH_DISABLESCRIPT) && !defined(CONFIG_NSH_DISABLE_TEST)
{ "test", cmd_test, 3, CONFIG_NSH_MAXARGUMENTS, "<expression>" }, CMD_MAP("test", cmd_test,
3, CONFIG_NSH_MAXARGUMENTS, "<expression>"),
#endif #endif
#ifndef CONFIG_NSH_DISABLE_TIME #ifndef CONFIG_NSH_DISABLE_TIME
{ "time", cmd_time, 2, 2, "\"<command>\"" }, CMD_MAP("time", cmd_time, 2, 2, "\"<command>\""),
#endif #endif
#ifndef CONFIG_NSH_DISABLE_TIMEDATECTL #ifndef CONFIG_NSH_DISABLE_TIMEDATECTL
{ "timedatectl", cmd_timedatectl, 1, 3, "[set-timezone TZ]" }, CMD_MAP("timedatectl", cmd_timedatectl, 1, 3, "[set-timezone TZ]"),
#endif #endif
#ifndef CONFIG_NSH_DISABLESCRIPT #ifndef CONFIG_NSH_DISABLESCRIPT
{ "true", cmd_true, 1, 1, NULL }, CMD_MAP("true", cmd_true, 1, 1, NULL),
#endif #endif
#ifndef CONFIG_DISABLE_MOUNTPOINT #ifndef CONFIG_DISABLE_MOUNTPOINT
# ifndef CONFIG_NSH_DISABLE_TRUNCATE # ifndef CONFIG_NSH_DISABLE_TRUNCATE
{ "truncate", cmd_truncate, 4, 4, "-s <length> <file-path>" }, CMD_MAP("truncate", cmd_truncate, 4, 4, "-s <length> <file-path>"),
# endif # endif
#endif #endif
#ifndef CONFIG_NSH_DISABLE_UNAME #ifndef CONFIG_NSH_DISABLE_UNAME
# ifdef CONFIG_NET # ifdef CONFIG_NET
{ "uname", cmd_uname, 1, 7, "[-a | -imnoprsv]" }, CMD_MAP("uname", cmd_uname, 1, 7, "[-a | -imnoprsv]"),
# else # else
{ "uname", cmd_uname, 1, 7, "[-a | -imoprsv]" }, CMD_MAP("uname", cmd_uname, 1, 7, "[-a | -imoprsv]"),
# endif # endif
#endif #endif
#if !defined(CONFIG_DISABLE_MOUNTPOINT) #if !defined(CONFIG_DISABLE_MOUNTPOINT)
# ifndef CONFIG_NSH_DISABLE_UMOUNT # ifndef CONFIG_NSH_DISABLE_UMOUNT
{ "umount", cmd_umount, 2, 2, "<dir-path>" }, CMD_MAP("umount", cmd_umount, 2, 2, "<dir-path>"),
# endif # endif
#endif #endif
#ifndef CONFIG_NSH_DISABLE_UNSET #ifndef CONFIG_NSH_DISABLE_UNSET
{ "unset", cmd_unset, 2, 2, "<name>" }, CMD_MAP("unset", cmd_unset, 2, 2, "<name>"),
#endif #endif
#ifndef CONFIG_NSH_DISABLE_UPTIME #ifndef CONFIG_NSH_DISABLE_UPTIME
{ "uptime", cmd_uptime, 1, 2, "[-sph]" }, CMD_MAP("uptime", cmd_uptime, 1, 2, "[-sph]"),
#endif #endif
#if defined(CONFIG_NETUTILS_CODECS) && defined(CONFIG_CODECS_URLCODE) #if defined(CONFIG_NETUTILS_CODECS) && defined(CONFIG_CODECS_URLCODE)
# ifndef CONFIG_NSH_DISABLE_URLDECODE # ifndef CONFIG_NSH_DISABLE_URLDECODE
{ "urldecode", cmd_urldecode, 2, 3, "[-f] <string or filepath>" }, CMD_MAP("urldecode", cmd_urldecode, 2, 3, "[-f] <string or filepath>"),
# endif # endif
# ifndef CONFIG_NSH_DISABLE_URLENCODE # ifndef CONFIG_NSH_DISABLE_URLENCODE
{ "urlencode", cmd_urlencode, 2, 3, "[-f] <string or filepath>" }, CMD_MAP("urlencode", cmd_urlencode, 2, 3, "[-f] <string or filepath>"),
# endif # endif
#endif #endif
@ -591,27 +611,27 @@ static const struct cmdmap_s g_cmdmap[] =
defined(CONFIG_NSH_LOGIN_PASSWD) && \ defined(CONFIG_NSH_LOGIN_PASSWD) && \
!defined(CONFIG_FSUTILS_PASSWD_READONLY) !defined(CONFIG_FSUTILS_PASSWD_READONLY)
# ifndef CONFIG_NSH_DISABLE_USERADD # ifndef CONFIG_NSH_DISABLE_USERADD
{ "useradd", cmd_useradd, 3, 3, "<username> <password>" }, CMD_MAP("useradd", cmd_useradd, 3, 3, "<username> <password>"),
# endif # endif
# ifndef CONFIG_NSH_DISABLE_USERDEL # ifndef CONFIG_NSH_DISABLE_USERDEL
{ "userdel", cmd_userdel, 2, 2, "<username>" }, CMD_MAP("userdel", cmd_userdel, 2, 2, "<username>"),
# endif # endif
#endif #endif
#ifndef CONFIG_NSH_DISABLE_USLEEP #ifndef CONFIG_NSH_DISABLE_USLEEP
{ "usleep", cmd_usleep, 2, 2, "<usec>" }, CMD_MAP("usleep", cmd_usleep, 2, 2, "<usec>"),
#endif #endif
#ifdef CONFIG_NET_TCP #ifdef CONFIG_NET_TCP
# ifndef CONFIG_NSH_DISABLE_WGET # ifndef CONFIG_NSH_DISABLE_WGET
{ "wget", cmd_wget, 2, 4, "[-o <local-path>] <url>" }, CMD_MAP("wget", cmd_wget, 2, 4, "[-o <local-path>] <url>"),
# endif # endif
#endif #endif
#ifndef CONFIG_NSH_DISABLE_XD #ifndef CONFIG_NSH_DISABLE_XD
{ "xd", cmd_xd, 3, 3, "<hex-address> <byte-count>" }, CMD_MAP("xd", cmd_xd, 3, 3, "<hex-address> <byte-count>"),
#endif #endif
{ NULL, NULL, 1, 1, NULL } CMD_MAP(NULL, NULL, 1, 1, NULL)
}; };
/**************************************************************************** /****************************************************************************