diff --git a/rust/rhg/src/commands.rs b/rust/rhg/src/commands.rs new file mode 100644 --- /dev/null +++ b/rust/rhg/src/commands.rs @@ -0,0 +1,8 @@ +use crate::error::CommandError; + +/// The common trait for rhg commands +/// +/// Normalize the interface of the commands provided by rhg +pub trait Command { + fn run(&self) -> Result<(), CommandError>; +} diff --git a/rust/rhg/src/error.rs b/rust/rhg/src/error.rs new file mode 100644 --- /dev/null +++ b/rust/rhg/src/error.rs @@ -0,0 +1,4 @@ + +/// The error type for the Command trait +#[derive(Debug, PartialEq)] +pub struct CommandError {} diff --git a/rust/rhg/src/main.rs b/rust/rhg/src/main.rs --- a/rust/rhg/src/main.rs +++ b/rust/rhg/src/main.rs @@ -1,3 +1,5 @@ +mod commands; +mod error; mod exitcode; fn main() {