summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNora <nora.widdecke@tu-bs.de>2019-02-24 21:34:57 +0100
committerNora <nora.widdecke@tu-bs.de>2019-02-24 21:34:57 +0100
commit4e915f3df6660e8f7d6de7a09a7c04e9d6a62267 (patch)
tree7d174b4777f312bde70bf9676a70949c111f9adc
parent253c5484047fbbff46402d7e3ebede5b170eee79 (diff)
structopt: copy
-rw-r--r--src/actions/copy.rs2
-rw-r--r--src/bin/khaleesi.rs2
-rw-r--r--src/cli.rs7
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::<Vec<&str>>())
}
- // "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)]