Allow enabling minibrowser from command line (#30042)

This commit is contained in:
Atbrakhi 2023-07-28 15:20:44 +02:00 committed by GitHub
parent 9fa67685f4
commit 25e2a6dfa1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -124,6 +124,9 @@ pub struct Opts {
/// Print Progressive Web Metrics to console.
pub print_pwm: bool,
/// True to enable minibrowser
pub minibrowser: bool,
}
fn print_usage(app: &str, opts: &Options) {
@ -408,6 +411,7 @@ pub fn default_opts() -> Opts {
unminify_js: false,
local_script_source: None,
print_pwm: false,
minibrowser: false,
}
}
@ -541,6 +545,7 @@ pub fn from_cmdline_args(mut opts: Options, args: &[String]) -> ArgumentParsingR
"Directory root with unminified scripts",
"",
);
opts.optflag("", "minibrowser", "Open minibrowser");
let opt_match = match opts.parse(args) {
Ok(m) => m,
@ -765,6 +770,7 @@ pub fn from_cmdline_args(mut opts: Options, args: &[String]) -> ArgumentParsingR
unminify_js: opt_match.opt_present("unminify-js"),
local_script_source: opt_match.opt_str("local-script-source"),
print_pwm: opt_match.opt_present("print-pwm"),
minibrowser: opt_match.opt_present("minibrowser"),
};
set_options(opts);