summaryrefslogtreecommitdiff
path: root/include/cli_readline.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/cli_readline.h')
-rw-r--r--include/cli_readline.h34
1 files changed, 34 insertions, 0 deletions
diff --git a/include/cli_readline.h b/include/cli_readline.h
new file mode 100644
index 0000000..f326106
--- /dev/null
+++ b/include/cli_readline.h
@@ -0,0 +1,34 @@
+/*
+ * (C) Copyright 2014-2016 Leo C. <erbl259-lmu@yahoo.de>
+ *
+ * (C) Copyright 2014 Google, Inc
+ * Simon Glass <sjg@chromium.org>
+ *
+ * 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 */
+
+/**
+ * cli_readline() - read a line into the console_buffer
+ *
+ * Display the prompt, then read a command line into console_buffer. The
+ * 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.
+ * Tab auto-complete is supported if CONFIG_AUTO_COMPLETE is defined.
+ *
+ * @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, bool enable_history);
+
+#endif /* CLI_READLINE_H */