diff --git a/etc/cli.yml b/etc/cli.yml index 50ca507c..53f3c9dc 100644 --- a/etc/cli.yml +++ b/etc/cli.yml @@ -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 diff --git a/src/cli.rs b/src/cli.rs index 3b1d8b4b..28e1b153 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -47,6 +47,10 @@ impl<'a> CliConfig<'a> { .and_then(|s| Some(rtp + s)) }) } + + pub fn editor(&self) -> Option { + self.cli_matches.value_of("editor").and_then(|s| Some(String::from(s))) + } } impl<'a> Debug for CliConfig<'a> {