diff options
author | Manos Pitsidianakis <el13635@mail.ntua.gr> | 2020-12-02 20:47:48 +0200 |
---|---|---|
committer | Manos Pitsidianakis <el13635@mail.ntua.gr> | 2020-12-02 21:01:22 +0200 |
commit | 48e7a493a92730bedccc5dfaac8242ed49d55a0d (patch) | |
tree | 0fea8098a1e5d5ced26efca389bb3e5f56157756 /src/command.rs | |
parent | e5b0ff4fe2799339076de95227b13d9755245f5f (diff) |
Add reload-config command
Closes #84 Add "reload configuration" command
Diffstat (limited to 'src/command.rs')
-rw-r--r-- | src/command.rs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/command.rs b/src/command.rs index ac08a898..2ad88fd3 100644 --- a/src/command.rs +++ b/src/command.rs @@ -790,6 +790,17 @@ Alternatives(&[to_stream!(One(Literal("add-attachment")), One(Filepath)), to_str Ok((input, Quit)) } ) + }, + { tags: ["reload-config"], + desc: "reload configuration file", + tokens: &[One(Literal("reload-config"))], + parser:( + fn reload_config(input: &[u8]) -> IResult<&[u8], Action> { + let (input, _) = tag("reload-config")(input.trim())?; + let (input, _) = eof(input.trim())?; + Ok((input, ReloadConfiguration)) + } + ) } ]); @@ -883,6 +894,7 @@ pub fn parse_command(input: &[u8]) -> Result<Action, MeliError> { account_action, print_setting, toggle_mouse, + reload_config, quit, ))(input) .map(|(_, v)| v) |