mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-24 09:40:52 +00:00
25 lines
431 B
Rust
25 lines
431 B
Rust
|
|
use crate::ShellCmdApi;
|
||
|
|
use xous::String;
|
||
|
|
|
||
|
|
pub struct Echo {
|
||
|
|
}
|
||
|
|
|
||
|
|
const VERB: &str = "echo";
|
||
|
|
|
||
|
|
impl ShellCmdApi for Echo {
|
||
|
|
fn matches(&self, verb: &str) -> bool {
|
||
|
|
if verb == VERB {
|
||
|
|
true
|
||
|
|
} else {
|
||
|
|
false
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
fn process(&self, rest: String::<1024>) -> Result<Option<String::<1024>>, xous::Error> {
|
||
|
|
Ok(Some(rest))
|
||
|
|
}
|
||
|
|
|
||
|
|
fn verb(&self) -> &str {
|
||
|
|
VERB
|
||
|
|
}
|
||
|
|
}
|