cli.rs: Add possibility to fetch editor
This commit is contained in:
parent
89878f7024
commit
4f8a545aac
2 changed files with 10 additions and 0 deletions
|
@ -22,6 +22,12 @@ args:
|
||||||
required: false
|
required: false
|
||||||
takes_value: true
|
takes_value: true
|
||||||
|
|
||||||
|
- editor:
|
||||||
|
short: e
|
||||||
|
long: editor
|
||||||
|
help: Set editor, if not set $EDITOR of the system will be asked, else vim
|
||||||
|
required: false
|
||||||
|
takes_value: true
|
||||||
|
|
||||||
- storename:
|
- storename:
|
||||||
short: s
|
short: s
|
||||||
|
|
|
@ -47,6 +47,10 @@ impl<'a> CliConfig<'a> {
|
||||||
.and_then(|s| Some(rtp + s))
|
.and_then(|s| Some(rtp + s))
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn editor(&self) -> Option<String> {
|
||||||
|
self.cli_matches.value_of("editor").and_then(|s| Some(String::from(s)))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'a> Debug for CliConfig<'a> {
|
impl<'a> Debug for CliConfig<'a> {
|
||||||
|
|
Loading…
Reference in a new issue