##// END OF EJS Templates
rhg: add Command trait for subcommands implemented by rhg...
Antoine Cezar -
r45515:bacf6c7e default
parent child Browse files
Show More
@@ -0,0 +1,8 b''
1 use crate::error::CommandError;
2
3 /// The common trait for rhg commands
4 ///
5 /// Normalize the interface of the commands provided by rhg
6 pub trait Command {
7 fn run(&self) -> Result<(), CommandError>;
8 }
@@ -0,0 +1,3 b''
1 /// The error type for the Command trait
2 #[derive(Debug, PartialEq)]
3 pub struct CommandError {}
@@ -1,5 +1,7 b''
1 mod commands;
2 mod error;
1 mod exitcode;
3 mod exitcode;
2
4
3 fn main() {
5 fn main() {
4 std::process::exit(exitcode::UNIMPLEMENTED_COMMAND)
6 std::process::exit(exitcode::UNIMPLEMENTED_COMMAND)
5 }
7 }
General Comments 0
You need to be logged in to leave comments. Login now