Add possibility to override store name in CLI
This commit is contained in:
parent
da85c3ffe7
commit
5942877c43
2 changed files with 14 additions and 0 deletions
|
@ -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
|
||||
|
|
|
@ -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> {
|
||||
|
|
Loading…
Reference in a new issue