From 4e915f3df6660e8f7d6de7a09a7c04e9d6a62267 Mon Sep 17 00:00:00 2001 From: Nora Date: Sun, 24 Feb 2019 21:34:57 +0100 Subject: structopt: copy --- src/actions/copy.rs | 2 +- src/bin/khaleesi.rs | 2 +- src/cli.rs | 7 +++++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/actions/copy.rs b/src/actions/copy.rs index 3aaeb8f..d5ea1e1 100644 --- a/src/actions/copy.rs +++ b/src/actions/copy.rs @@ -4,7 +4,7 @@ use crate::utils::misc; use crate::KhResult; -pub fn do_copy(_args: &[&str]) -> KhResult<()> { +pub fn do_copy() -> KhResult<()> { let khline = input::default_input_khline()?; let uid = &misc::make_new_uid(); diff --git a/src/bin/khaleesi.rs b/src/bin/khaleesi.rs index c27fca7..c0a6d73 100644 --- a/src/bin/khaleesi.rs +++ b/src/bin/khaleesi.rs @@ -43,7 +43,7 @@ fn main_internal(args: &cli::CommandLine, config: &Config) -> KhResult<()> { cli::Command::Agenda(x) => { agenda::show_events(&config, &x.args.iter().map(|x| x.as_ref()).collect::>()) } - // "copy" => copy::do_copy(args), + cli::Command::Copy => copy::do_copy(), // "cursor" => cursor::do_cursor(args), // "delete" => delete::do_delete(args), // "edit" => edit::do_edit(args), diff --git a/src/cli.rs b/src/cli.rs index 519988b..5b4146d 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -8,7 +8,7 @@ use std::path::PathBuf; about = "Command line calendar tool." )] pub struct CommandLine { - /// Verbosity + /// verbosity #[structopt(short = "v", parse(from_occurrences))] pub verbosity: u64, #[structopt(subcommand)] @@ -22,7 +22,10 @@ pub enum Command { Agenda(Agenda), /// Rebuild index #[structopt(name = "index")] - Index(Index) + Index(Index), + /// Copy event + #[structopt(name = "copy")] + Copy, } #[derive(Debug, StructOpt)] -- cgit v1.2.3