diff options
author | Matthias Beyer <mail@beyermatthias.de> | 2016-07-06 19:51:21 +0200 |
---|---|---|
committer | Matthias Beyer <mail@beyermatthias.de> | 2016-07-06 19:59:29 +0200 |
commit | 247cda035296b519802714e4228913014a052dbb (patch) | |
tree | b349a069753185de3576ffb66402e3c720afaec4 /imag-todo | |
parent | aef80874da57bb434d6cac0fd65ad0940def8964 (diff) |
Rip out exec()
Diffstat (limited to 'imag-todo')
-rw-r--r-- | imag-todo/src/main.rs | 24 | ||||
-rw-r--r-- | imag-todo/src/ui.rs | 14 |
2 files changed, 0 insertions, 38 deletions
diff --git a/imag-todo/src/main.rs b/imag-todo/src/main.rs index e1610dc4..31274761 100644 --- a/imag-todo/src/main.rs +++ b/imag-todo/src/main.rs @@ -46,7 +46,6 @@ fn main() { match rt.cli().subcommand_name() { Some("tw-hook") => tw_hook(&rt), - Some("exec") => exec(&rt), Some("list") => list(&rt), _ => unimplemented!(), } // end match scmd @@ -136,29 +135,6 @@ fn tw_hook(rt: &Runtime) { } } -fn exec(rt: &Runtime) { - let subcmd = rt.cli().subcommand_matches("exec").unwrap(); - let mut args = Vec::new(); - if let Some(exec_string) = subcmd.values_of("command") { - for e in exec_string { - args.push(e); - } - let tw_process = Command::new("task").stdin(Stdio::null()).args(&args).spawn().unwrap_or_else(|e| { - panic!("failed to execute taskwarrior: {}", e); - }); - - let output = tw_process.wait_with_output().unwrap_or_else(|e| { - panic!("failed to unwrap output: {}", e); - }); - let outstring = String::from_utf8(output.stdout).unwrap_or_else(|e| { - panic!("failed to ececute: {}", e); - }); - println!("{}", outstring); - } else { - panic!("faild to execute: You need to exec --command"); - } -} - fn list(rt: &Runtime) { let subcmd = rt.cli().subcommand_matches("list").unwrap(); let mut args = Vec::new(); diff --git a/imag-todo/src/ui.rs b/imag-todo/src/ui.rs index ae2adc07..507f4379 100644 --- a/imag-todo/src/ui.rs +++ b/imag-todo/src/ui.rs @@ -27,20 +27,6 @@ pub fn build_ui<'a>(app: App<'a, 'a>) -> App<'a, 'a> { .required(true)) ) - .subcommand(SubCommand::with_name("exec") - .about("Send a command to taskwarrior") - .version("0.1") - - .arg(Arg::with_name("command") - .long("command") - .short("c") - .takes_value(true) - .multiple(true) - .required(true) - .help("Args written in the string will be send directly to taskwarrior") - ) - ) - .subcommand(SubCommand::with_name("add") .about("create a task") .version("0.1") |