diff options
author | Canop <cano.petrole@gmail.com> | 2022-06-19 20:16:14 +0200 |
---|---|---|
committer | Canop <cano.petrole@gmail.com> | 2022-06-19 20:16:14 +0200 |
commit | 15e0d2acebaebf6db04794c53cf5a483a1503c24 (patch) | |
tree | 7a635c3c97ab1fa7ddd365b4f9078884d1042422 /src/tree | |
parent | 0a34abdf7e1fa4aaaf2da641b3083dd0b015f2da (diff) |
fix default_flags in conf not working anymore
Fix #566
Diffstat (limited to 'src/tree')
-rw-r--r-- | src/tree/tree_options.rs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/tree/tree_options.rs b/src/tree/tree_options.rs index 52f9b6c..7548e50 100644 --- a/src/tree/tree_options.rs +++ b/src/tree/tree_options.rs @@ -80,7 +80,10 @@ impl TreeOptions { pub fn apply_config(&mut self, config: &Conf) -> Result<(), ConfError> { if let Some(default_flags) = &config.default_flags { let flags_args = format!("-{}", default_flags); - let conf_matches = Args::parse_from(vec![&flags_args]); + let conf_matches = Args::try_parse_from(vec!["broot", &flags_args]) + .map_err(|_| ConfError::InvalidDefaultFlags { + flags: default_flags.to_string() + })?; self.apply_launch_args(&conf_matches); } if let Some(b) = &config.show_selection_mark { |