mirror of
https://github.com/jht5945/prettyjson.git
synced 2025-12-27 09:10:04 +08:00
modify Options
This commit is contained in:
@@ -31,8 +31,7 @@ Written by Hatter Jiang
|
||||
|
||||
|
||||
fn main() {
|
||||
let mut options = Options::new();
|
||||
options.parse_args();
|
||||
let options = Options::parse_args_static();
|
||||
|
||||
if options.verbose {
|
||||
print_message(MessageType::DEBUG, &format!("{} version: {}, git hash: {}", NAME, VERSION, GIT_HASH));
|
||||
|
||||
@@ -20,6 +20,12 @@ impl Options {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn parse_args_static() -> Options {
|
||||
let mut opt = Options::new();
|
||||
opt.parse_args();
|
||||
opt
|
||||
}
|
||||
|
||||
pub fn parse_args(&mut self) {
|
||||
let mut ap = ArgumentParser::new();
|
||||
ap.set_description("prettyjson - command line JSON pretty tool.");
|
||||
|
||||
Reference in New Issue
Block a user