xous-core/services/shellchat/src/cmds/echo.rs
bunnie 9566355f9a refactor command API
should be a bit more convenient now to add/modify command
lists as time goes on
2021-03-10 22:59:52 +08:00

25 lines
No EOL
451 B
Rust

use crate::ShellCmdApi;
use xous::String;
pub struct Echo {
}
const VERB: &str = "echo";
impl<'a> ShellCmdApi<'a> for Echo {
fn matches(&self, verb: &str) -> bool {
if verb == VERB {
true
} else {
false
}
}
fn process(&mut self, rest: String::<1024>) -> Result<Option<String::<1024>>, xous::Error> {
Ok(Some(rest))
}
fn verb(&self) -> &'static str {
VERB
}
}