cli.rs: Add possibility to fetch editor

This commit is contained in:
Matthias Beyer 2015-12-30 02:40:56 +01:00
parent 89878f7024
commit 4f8a545aac
2 changed files with 10 additions and 0 deletions

View file

@ -22,6 +22,12 @@ args:
required: false
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:
short: s

View file

@ -47,6 +47,10 @@ impl<'a> CliConfig<'a> {
.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> {