Readline: Fix a configuration dependency. If we are not echoing to the console, then we cannot support tab completion
This commit is contained in:
parent
169c3c77f1
commit
5aa53ea2db
@ -43,23 +43,35 @@
|
|||||||
#include <nuttx/config.h>
|
#include <nuttx/config.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
|
#ifdef CONFIG_SYSTEM_READLINE
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Pre-processor Definitions
|
* Pre-processor Definitions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
/* Tab completion cannot be supported if there is no console echo */
|
||||||
|
|
||||||
#ifndef CONFIG_READLINE_MAX_BUILTINS
|
#ifndef CONFIG_READLINE_ECHO
|
||||||
# define CONFIG_READLINE_MAX_BUILTINS 64
|
# undef CONFIG_READLINE_TABCOMPLETION
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef CONFIG_READLINE_MAX_EXTCMDS
|
/* Make sure that the are valid values for all tab-completion settings */
|
||||||
|
|
||||||
|
#ifdef CONFIG_READLINE_TABCOMPLETION
|
||||||
|
# ifndef CONFIG_READLINE_MAX_BUILTINS
|
||||||
|
# define CONFIG_READLINE_MAX_BUILTINS 64
|
||||||
|
# endif
|
||||||
|
|
||||||
|
# ifndef CONFIG_READLINE_MAX_EXTCMDS
|
||||||
# define CONFIG_READLINE_MAX_EXTCMDS 64
|
# define CONFIG_READLINE_MAX_EXTCMDS 64
|
||||||
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Public Types
|
* Public Types
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#if defined(CONFIG_READLINE_TABCOMPLETION) && defined(CONFIG_READLINE_HAVE_EXTMATCH)
|
#if defined(CONFIG_READLINE_TABCOMPLETION) && \
|
||||||
|
defined(CONFIG_READLINE_HAVE_EXTMATCH)
|
||||||
struct extmatch_vtable_s
|
struct extmatch_vtable_s
|
||||||
{
|
{
|
||||||
CODE int (*count_matches)(FAR char *name, FAR int *matches, int namelen);
|
CODE int (*count_matches)(FAR char *name, FAR int *matches, int namelen);
|
||||||
@ -118,7 +130,7 @@ FAR const char *readline_prompt(FAR const char *prompt);
|
|||||||
* Name: readline_extmatch
|
* Name: readline_extmatch
|
||||||
*
|
*
|
||||||
* If the applications supports a command set, then it may call this
|
* If the applications supports a command set, then it may call this
|
||||||
* function in order to provide support for tab complete on these\
|
* function in order to provide support for tab complete on these
|
||||||
* "external" commands
|
* "external" commands
|
||||||
*
|
*
|
||||||
* Input Parameters:
|
* Input Parameters:
|
||||||
@ -138,7 +150,8 @@ FAR const char *readline_prompt(FAR const char *prompt);
|
|||||||
*
|
*
|
||||||
**************************************************************************/
|
**************************************************************************/
|
||||||
|
|
||||||
#if defined(CONFIG_READLINE_TABCOMPLETION) && defined(CONFIG_READLINE_HAVE_EXTMATCH)
|
#if defined(CONFIG_READLINE_TABCOMPLETION) && \
|
||||||
|
defined(CONFIG_READLINE_HAVE_EXTMATCH)
|
||||||
FAR const struct extmatch_vtable_s *
|
FAR const struct extmatch_vtable_s *
|
||||||
readline_extmatch(FAR const struct extmatch_vtable_s *vtbl);
|
readline_extmatch(FAR const struct extmatch_vtable_s *vtbl);
|
||||||
#endif
|
#endif
|
||||||
@ -214,4 +227,5 @@ ssize_t std_readline(FAR char *buf, int buflen);
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#endif /* CONFIG_SYSTEM_READLINE */
|
||||||
#endif /* __APPS_INCLUDE_READLINE_H */
|
#endif /* __APPS_INCLUDE_READLINE_H */
|
||||||
|
@ -24,6 +24,8 @@ config READLINE_ECHO
|
|||||||
already has local echo support or you need to suppress the back-channel
|
already has local echo support or you need to suppress the back-channel
|
||||||
responses for any other reason.
|
responses for any other reason.
|
||||||
|
|
||||||
|
if READLINE_ECHO
|
||||||
|
|
||||||
config READLINE_TABCOMPLETION
|
config READLINE_TABCOMPLETION
|
||||||
bool "Tab completion"
|
bool "Tab completion"
|
||||||
default n
|
default n
|
||||||
@ -51,4 +53,5 @@ config READLINE_MAX_EXTCMDS
|
|||||||
will be displayed.
|
will be displayed.
|
||||||
|
|
||||||
endif # READLINE_TABCOMPLETION
|
endif # READLINE_TABCOMPLETION
|
||||||
|
endif # READLINE_ECHO
|
||||||
endif # SYSTEM_READLINE
|
endif # SYSTEM_READLINE
|
||||||
|
Loading…
x
Reference in New Issue
Block a user