mirror of
https://github.com/apache/nuttx-apps.git
synced 2025-10-19 19:44:35 +08:00
nsh/nshlib: Add alias support for nsh
This adds support for string aliases into nsh. There are some nuances that are not handled correctly yet: - Reserved words can be overloaded, which is a clear POSIX violation
This commit is contained in:

committed by
Petro Karashchenko

parent
bf40833d2e
commit
f9dfb51001
@@ -104,6 +104,13 @@ static const struct cmdmap_s g_cmdmap[] =
|
||||
{ "addroute", cmd_addroute, 3, 4, "<target> [<netmask>] <router>" },
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_NSH_ALIAS
|
||||
{ "alias", cmd_alias, 1, CONFIG_NSH_MAXARGUMENTS,
|
||||
"[name[=value] ... ]" },
|
||||
{ "unalias", cmd_unalias, 1, CONFIG_NSH_MAXARGUMENTS,
|
||||
"[-a] name [name ... ]" },
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_NET) && defined(CONFIG_NET_ARP) && !defined(CONFIG_NSH_DISABLE_ARP)
|
||||
{ "arp", cmd_arp, 1, 6,
|
||||
"[-i <ifname>] [-a <ipaddr>|-d <ipaddr>|-s <ipaddr> <hwaddr>]" },
|
||||
|
Reference in New Issue
Block a user