cli.rs: Add function to fetch editor options

This commit is contained in:
Matthias Beyer 2015-12-30 02:42:55 +01:00
parent 6179c9e73f
commit 6ff2ac3567
2 changed files with 13 additions and 0 deletions

View file

@ -29,6 +29,12 @@ args:
required: false
takes_value: true
- editor_opts:
long: editor-opts
help: Set editor options
required: false
takes_value: true
- storename:
short: s
long: storename

View file

@ -51,6 +51,13 @@ impl<'a> CliConfig<'a> {
pub fn editor(&self) -> Option<String> {
self.cli_matches.value_of("editor").and_then(|s| Some(String::from(s)))
}
pub fn editor_opts(&self) -> String {
self.cli_matches
.value_of("editor_opts")
.map(|s| String::from(s))
.unwrap_or(String::from(""))
}
}
impl<'a> Debug for CliConfig<'a> {