[FL-1555] Cli: update motd (#584)
* Cli: update motd * Cli: autocomplete and cursor. * Cli: one line history. * Cli: minor cleanup, remove double flush, remove prompt on empty autocomplete
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
|
||||
#include <m-dict.h>
|
||||
#include <m-bptree.h>
|
||||
#include <m-array.h>
|
||||
|
||||
#define CLI_LINE_SIZE_MAX
|
||||
#define CLI_COMMANDS_TREE_RANK 4
|
||||
@@ -24,15 +25,23 @@ BPTREE_DEF2(
|
||||
CliCommand,
|
||||
M_POD_OPLIST)
|
||||
|
||||
#define M_OPL_CliCommandTree_t() BPTREE_OPLIST(CliCommandTree, M_POD_OPLIST)
|
||||
|
||||
struct Cli {
|
||||
CliCommandTree_t commands;
|
||||
osMutexId_t mutex;
|
||||
string_t last_line;
|
||||
string_t line;
|
||||
|
||||
size_t cursor_position;
|
||||
};
|
||||
|
||||
Cli* cli_alloc();
|
||||
|
||||
void cli_free(Cli* cli);
|
||||
void cli_reset_state(Cli* cli);
|
||||
void cli_print_version(const Version* version);
|
||||
|
||||
void cli_reset(Cli* cli);
|
||||
|
||||
void cli_putc(char c);
|
||||
|
||||
void cli_stdout_callback(void* _cookie, const char* data, size_t size);
|
||||
|
Reference in New Issue
Block a user