]> cloudbase.mooo.com Git - z180-stamp.git/blobdiff - include/cli_readline.h
Store only command line input in history buffer, but not data (i.e mm command)
[z180-stamp.git] / include / cli_readline.h
index 5b25762720cb0ae8f9955fd251bf84b5b1e3841f..0e165cc11e1ebe65d58b588074de3b9239691cb7 100644 (file)
@@ -1,13 +1,18 @@
 /*
+ * (C) Copyright 2014 Leo C. <erbl259-lmu@yahoo.de>
+ *
  * (C) Copyright 2014 Google, Inc
  * Simon Glass <sjg@chromium.org>
  *
- * SPDX-License-Identifier:    GPL-2.0+
+ * SPDX-License-Identifier:    GPL-2.0
  */
 
 #ifndef CLI_READLINE_H
 #define CLI_READLINE_H
 
+#include "common.h"
+#include <stdbool.h>
+
 extern char console_buffer[];  /* console I/O buffer   */
 
 /**
@@ -16,9 +21,10 @@ extern char console_buffer[];        /* console I/O buffer   */
  * This is a convenience function which calls cli_readline_into_buffer().
  *
  * @prompt: Prompt to display
+ * @enable_history: Use history buffer if true
  * @return command line length excluding terminator, or -ve on error
  */
-int cli_readline(const FLASH char *const prompt);
+int cli_readline(const FLASH char *const prompt, bool enable_history);
 
 /**
  * readline_into_buffer() - read a line into a buffer
@@ -27,10 +33,9 @@ int cli_readline(const FLASH char *const prompt);
  * maximum line length is CONFIG_SYS_CBSIZE including a \0 terminator, which
  * will always be added.
  *
- * The command is echoed as it is typed. Command editing is supported if
- * CONFIG_CMDLINE_EDITING is defined. Tab auto-complete is supported if
- * CONFIG_AUTO_COMPLETE is defined. If CONFIG_BOOT_RETRY_TIME is defined,
- * then a timeout will be applied.
+ * The command is echoed as it is typed. Command editing is supported.
+ * Tab auto-complete is supported if CONFIG_AUTO_COMPLETE is defined.
+ * If CONFIG_BOOT_RETRY_TIME is defined, then a timeout will be applied.
  *
  * If CONFIG_BOOT_RETRY_TIME is defined and retry_time >= 0,
  * time out when time goes past endtime (timebase time in ticks).
@@ -43,8 +48,8 @@ int cli_readline(const FLASH char *const prompt);
  * parameter), then -2 is returned. If a break is detected (Ctrl-C) then
  * -1 is returned.
  */
-//int cli_readline_into_buffer(const char *const prompt, char *buffer, int timeout);
+//int cli_readline_into_buffer(const char *const prompt, char *buffer,
+//                     int timeout, bool enable_history);
 
 
 #endif /* CLI_READLINE_H */
-