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.
- Host: GitHub
- URL: https://github.com/frectonz/cmd-rs
- Owner: frectonz
- Created: 2024-03-07T03:53:40.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-03-07T04:00:25.000Z (over 2 years ago)
- Last Synced: 2025-01-14T03:16:28.897Z (over 1 year ago)
- Language: Rust
- Homepage:
- Size: 6.84 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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");
}
}
```