M src/main.rs +4 -18
@@ 3,30 3,16 @@ use structopt::StructOpt;
mod commands;
mod dirstate;
mod errors;
+mod options;
mod revlogs;
-#[derive(StructOpt)]
-#[structopt(
- name = "rug",
- about = "A rust implementation of some hg functionality",
- author = "Nathan Goldbaum",
- version = "0.1",
- raw(setting = "structopt::clap::AppSettings::ArgRequiredElseHelp")
-)]
-enum Rug {
- #[structopt(name = "log")]
- Log {},
- #[structopt(name = "status")]
- Status {},
-}
-
fn main() {
- match Rug::from_args() {
- Rug::Log {} => match commands::hg_log() {
+ match options::Rug::from_args() {
+ options::Rug::Log {} => match commands::hg_log() {
Ok(_) => {}
Err(e) => println!("{}", e),
},
- Rug::Status {} => match commands::hg_status() {
+ options::Rug::Status {} => match commands::hg_status() {
Ok(_) => {}
Err(e) => println!("{}", e),
},
A => src/options.rs +16 -0
@@ 0,0 1,16 @@
+use structopt::StructOpt;
+
+#[derive(StructOpt)]
+#[structopt(
+ name = "rug",
+ about = "A rust implementation of some hg functionality",
+ author = "Nathan Goldbaum",
+ version = "0.1",
+ raw(setting = "structopt::clap::AppSettings::ArgRequiredElseHelp")
+)]
+pub enum Rug {
+ #[structopt(name = "log")]
+ Log {},
+ #[structopt(name = "status")]
+ Status {},
+}