An open API service indexing awesome lists of open source software.

https://github.com/frectonz/cmd-rs

Python's cmd module implemented in Rust via proc macros.
https://github.com/frectonz/cmd-rs

Last synced: about 1 month ago
JSON representation

Python's cmd module implemented in Rust via proc macros.

Awesome Lists containing this project

README

          

# cmd-rs

Python's cmd module implemented in Rust via proc macros.

```rust
/// A repl that just echos
#[derive(Cmd)]
struct Echoer;

#[cmd_handler]
impl Echoer {
/// echo message back
fn do_echo(&mut self, arg: &str) {
println!("Echo: {}", arg);
}

fn postcmd(&self) {
println!("post command");
}
}
```