Add possibility to override store name in CLI

This commit is contained in:
Matthias Beyer 2015-12-01 18:37:29 +01:00
parent da85c3ffe7
commit 5942877c43
2 changed files with 14 additions and 0 deletions

View file

@ -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

View file

@ -41,6 +41,14 @@ impl<'a> CliConfig<'a> {
pub fn get_rtp(&self) -> Option<String> {
self.cli_matches.value_of("rtp").and_then(|s| Some(String::from(s)))
}
pub fn store_path(&self) -> Option<String> {
self.get_rtp().and_then(|rtp| {
self.cli_matches
.value_of("storepath")
.and_then(|s| Some(rtp + s))
})
}
}
impl<'a> Debug for CliConfig<'a> {