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
@@ -33,6 +33,8 @@
|
||||
#include <stdbool.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include <nuttx/queue.h>
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
****************************************************************************/
|
||||
@@ -119,6 +121,14 @@ struct nsh_vtbl_s
|
||||
char iobuffer[IOBUFFERSIZE];
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_NSH_ALIAS
|
||||
/* Shell alias support */
|
||||
|
||||
struct nsh_alias_s atab[CONFIG_NSH_ALIAS_MAX_AMOUNT];
|
||||
struct sq_queue_s alist;
|
||||
struct sq_queue_s afreelist;
|
||||
#endif
|
||||
|
||||
/* Parser state data */
|
||||
|
||||
struct nsh_parser_s np;
|
||||
|
Reference in New Issue
Block a user