From 5942877c43a96af939b6b66d941a7567269aab93 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Tue, 1 Dec 2015 18:37:29 +0100 Subject: [PATCH] Add possibility to override store name in CLI --- etc/cli.yml | 6 ++++++ src/cli.rs | 8 ++++++++ 2 files changed, 14 insertions(+) diff --git a/etc/cli.yml b/etc/cli.yml index 93eed6cb..d86660ea 100644 --- a/etc/cli.yml +++ b/etc/cli.yml @@ -21,6 +21,12 @@ args: help: Set the runtime path required: false + - storename: + short: s + long: storename + help: Name of the store in the runtimepath. Defaults to "store" + required: false + subcommands: - cal: about: Calendar module diff --git a/src/cli.rs b/src/cli.rs index 2a4f25bc..42b8d563 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -41,6 +41,14 @@ impl<'a> CliConfig<'a> { pub fn get_rtp(&self) -> Option { self.cli_matches.value_of("rtp").and_then(|s| Some(String::from(s))) } + + pub fn store_path(&self) -> Option { + self.get_rtp().and_then(|rtp| { + self.cli_matches + .value_of("storepath") + .and_then(|s| Some(rtp + s)) + }) + } } impl<'a> Debug for CliConfig<'a> {