Replace common functionality with rust implementation

This commit is contained in:
2025-09-03 17:06:13 +02:00
parent d0d162f3e9
commit d31d39473b
38 changed files with 2871 additions and 204 deletions

19
mgr/src/cli.rs Normal file
View File

@@ -0,0 +1,19 @@
use thiserror::Error;
#[derive(Error, Debug)]
pub enum ParseError {
#[error("no action given")]
MissingAction,
#[error("unknown action: {action}")]
UnknownAction { action: String },
#[error("unexpected input: {rest:?}")]
UnexpectedInput { rest: Vec<String> },
}
pub trait CliCommand {
type ExecErr: From<ParseError>;
fn parse_str(input: &str, rest: impl Iterator<Item = String>) -> Result<Self, ParseError>
where
Self: Sized;
}