Added json output function

This commit is contained in:
Fukushima Shogo
2024-04-25 12:18:16 +09:00
committed by andy.boot
parent a3dcab9454
commit 184ea1f956
12 changed files with 232 additions and 4 deletions
+4
View File
@@ -29,6 +29,7 @@ pub struct Config {
pub depth: Option<usize>,
pub bars_on_right: Option<bool>,
pub stack_size: Option<usize>,
pub output_json: Option<bool>,
}
impl Config {
@@ -117,6 +118,9 @@ impl Config {
from_cmd_line.copied()
}
}
pub fn get_output_json(&self, options: &ArgMatches) -> bool {
Some(true) == self.output_json || options.get_flag("output_json")
}
}
fn convert_min_size(input: &str) -> Option<usize> {