-
Notifications
You must be signed in to change notification settings - Fork 53
Description
Background
I am utilizing embedded-cli to drive functional hardware tests via Python. Currently, the presence of escape codes adds some unwanted "noise" to the received data buffer + features like history and autocomplete are not needed in such use-case.
It's not that one can't deal with some input sanitization and parsing on the controlling entity's side, but if a dedicated and simple configuration would allow for turning these things off, one would not have to take care of it at all.
New feature proposal
I would like to propose a mechanism that would a user to selectively turn some features off in case one does not need them.
When some these features are turned off, CLI should behave in the following manner:
- For input part, history of commands and autocomplete is not enabled, it's just a plain echo-like behavior until line termination is received
- For output, only what user decides to send to the CLI output is printed - i.e. no escape sequences
Furthermore, I suggest that the following attributes should be exposed to a dedicated configuration layer (e.g. CliConfig.h or in main header):
- What line termination is appended at the end of a command (e.g. "\n" vs "\r\n")
- Invitation prompt selectable by a user (default one is "> "
- Configuration to selectively turn some features off (maybe with one that enables minimal CLI where bare minimum is offered - automation friendly)
I'm doing the above regardless for my own needs but I wanted to share the idea.
If that is something that would be welcomed, I could make a PR once it's ready.
Keep in mind that the above is just a rough concept so it's still in rather early phase in my head.
As always, I'm open to any suggestions and ideas.
BR,
Michael