summaryrefslogtreecommitdiff
path: root/apps/nshlib/nsh_stdsession.c
diff options
context:
space:
mode:
authorGregory Nutt <gnutt@nuttx.org>2014-02-02 10:25:53 -0600
committerGregory Nutt <gnutt@nuttx.org>2014-02-02 10:25:53 -0600
commitc9b74c175ad4502245cace41464aba69f8a1eaec (patch)
tree7e2b4789194c6b3e6865e24aee5bac6a7c0fe484 /apps/nshlib/nsh_stdsession.c
parente364cc0f190f65ca37a08fbba3daa577d23cf51b (diff)
downloadpx4-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_stdsession.c')
-rw-r--r--apps/nshlib/nsh_stdsession.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/apps/nshlib/nsh_stdsession.c b/apps/nshlib/nsh_stdsession.c
index 11fae7db7..07def5b3b 100644
--- a/apps/nshlib/nsh_stdsession.c
+++ b/apps/nshlib/nsh_stdsession.c
@@ -1,7 +1,7 @@
/****************************************************************************
* apps/nshlib/nsh_stdsession.c
*
- * Copyright (C) 2013 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2013-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"
@@ -124,7 +128,12 @@ 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,
+ stdin, stdout);
+#else
ret = std_readline(pstate->cn_line, CONFIG_NSH_LINELEN);
+#endif
if (ret != EOF)
{
/* Parse process the command */