Crates.io | light-cli |
lib.rs | light-cli |
version | 0.1.0 |
source | src |
created_at | 2019-03-15 14:59:29.664731 |
updated_at | 2019-03-15 14:59:29.664731 |
description | simple heapless command line interface parser for embedded devices |
homepage | |
repository | https://github.com/rudihorn/light-cli |
max_upload_size | |
id | 121052 |
size | 36,619 |
light-cli
A lightweight and heapless command line interface / command passing tool. Probably more useful for machine to machine communication.
The following definition allows for the commands:
HELLO Name=<Name>
: Set the name to <Name>
EHLO
: Return the namelightcli!(cl_in, cl_out, cmd, key, val, [
"HELLO" => [
"Name" => name = String::from(val)
] => { writeln!(cl_out, "Name set").unwrap(); };
"EHLO" => [
] => { writeln!(cl_out, "EHLO Name={}", name.as_str()).unwrap(); }
]);
A typical serial communication could look like:
>> EHLO
<< EHLO Name=
>> HELLO Name=Johnson
<< Name set
>> EHLO
<< EHLO Name=Johnson
It is recommended to use this in conjunction with the program rlwrap
.
COMMAND KEY=VALUE
Licensed under either of
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.