macro_rules! lightcli {
($cli:expr, $cl_out:expr, $cmd:ident, $key:ident, $val:ident, [
$(
$cmdv:pat => [
$( $keyv:pat => $action:expr ),*
] => $done:expr
);*
]) => { ... };
}Expand description
This macro allows for an easy way to define key value commands.
§Arguments
$cli: TheLightCliInputinstance to parse data from.$cl_out: TheLightCliOutputinstance to write errors to.$cmd: The identifier to use to access the current command.$key: The identifier to use to access the curernt key.$val: The identifier to use to access the curernt value.$cmdv: The name of the command.$keyv: The key for command$cmdv.$action: What to do with the value$valfor the given command and key.$done: What to do when the command is complete.
§Remarks
For a command that doesn’t use the output and allows for custom
error handling see the macro lightcli_adv!. This macro makes use
of the underlying function parse_data.