diff options
author | Gregory Nutt <gnutt@nuttx.org> | 2014-02-02 10:25:53 -0600 |
---|---|---|
committer | Gregory Nutt <gnutt@nuttx.org> | 2014-02-02 10:25:53 -0600 |
commit | c9b74c175ad4502245cace41464aba69f8a1eaec (patch) | |
tree | 7e2b4789194c6b3e6865e24aee5bac6a7c0fe484 /apps/nshlib/nsh_session.c | |
parent | e364cc0f190f65ca37a08fbba3daa577d23cf51b (diff) | |
download | px4-nuttx-c9b74c175ad4502245cace41464aba69f8a1eaec.tar.gz px4-nuttx-c9b74c175ad4502245cace41464aba69f8a1eaec.tar.bz2 px4-nuttx-c9b74c175ad4502245cace41464aba69f8a1eaec.zip |
Add an EMACS-like command line editor that can be used wit NSH
Diffstat (limited to 'apps/nshlib/nsh_session.c')
-rw-r--r-- | apps/nshlib/nsh_session.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/apps/nshlib/nsh_session.c b/apps/nshlib/nsh_session.c index 2272b1e30..de6710bfe 100644 --- a/apps/nshlib/nsh_session.c +++ b/apps/nshlib/nsh_session.c @@ -1,7 +1,7 @@ /**************************************************************************** * apps/nshlib/nsh_session.c * - * Copyright (C) 2007-2009, 2011-2013 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2009, 2011-2014 Gregory Nutt. All rights reserved. * Author: Gregory Nutt <gnutt@nuttx.org> * * Redistribution and use in source and binary forms, with or without @@ -42,7 +42,11 @@ #include <stdio.h> #include <stdlib.h> -#include <apps/readline.h> +#ifdef CONFIG_NSH_CLE +# include <apps/cle.h> +#else +# include <apps/readline.h> +#endif #include "nsh.h" #include "nsh_console.h" @@ -133,8 +137,13 @@ int nsh_session(FAR struct console_stdio_s *pstate) * or any read failure. */ +#ifdef CONFIG_NSH_CLE + ret = cle(pstate->cn_line, CONFIG_NSH_LINELEN, + INSTREAM(pstate), OUTSTREAM(pstate)); +#else ret = readline(pstate->cn_line, CONFIG_NSH_LINELEN, INSTREAM(pstate), OUTSTREAM(pstate)); +#endif if (ret != EOF) { /* Parse process the command */ |