mirror of
https://github.com/servo/servo.git
synced 2025-08-04 05:00:08 +01:00
OHOS: Workaround for a bug in getopts and updating the crate.
Currently getopts does not work with the devtools flag and just ignores the argument to it. This was actually raised in https://github.com/servo/servo/issues/28306. This workaround (by renaming the flag to have a dash) fixes this for some reason. The getopts issue is tracked here https://github.com/rust-lang/getopts/issues/104. Additionally, I updated the dependency as it was quite out of date. Signed-off-by: Narfinger <Narfinger@users.noreply.github.com>
This commit is contained in:
parent
3a527d784b
commit
e0919f709f
2 changed files with 10 additions and 3 deletions
|
@ -58,7 +58,7 @@ fnv = "1.0"
|
||||||
fonts_traits = { path = "components/shared/fonts" }
|
fonts_traits = { path = "components/shared/fonts" }
|
||||||
freetype-sys = "0.20"
|
freetype-sys = "0.20"
|
||||||
fxhash = "0.2"
|
fxhash = "0.2"
|
||||||
getopts = "0.2.11"
|
getopts = "0.2.21"
|
||||||
gleam = "0.15"
|
gleam = "0.15"
|
||||||
glib = "0.19"
|
glib = "0.19"
|
||||||
glow = "0.16"
|
glow = "0.16"
|
||||||
|
|
|
@ -363,6 +363,13 @@ pub(crate) fn parse_command_line_arguments(args: Vec<String>) -> ArgumentParsing
|
||||||
"FILTER",
|
"FILTER",
|
||||||
);
|
);
|
||||||
|
|
||||||
|
opts.optmulti(
|
||||||
|
"",
|
||||||
|
"dev-tools",
|
||||||
|
"Start the devtools on the supplied port",
|
||||||
|
"1234",
|
||||||
|
);
|
||||||
|
|
||||||
opts.optflag(
|
opts.optflag(
|
||||||
"",
|
"",
|
||||||
"enable-experimental-web-platform-features",
|
"enable-experimental-web-platform-features",
|
||||||
|
@ -506,9 +513,9 @@ pub(crate) fn parse_command_line_arguments(args: Vec<String>) -> ArgumentParsing
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
if opt_match.opt_present("devtools") {
|
if opt_match.opt_present("dev-tools") {
|
||||||
let port = opt_match
|
let port = opt_match
|
||||||
.opt_str("devtools")
|
.opt_str("dev-tools")
|
||||||
.map(|port| {
|
.map(|port| {
|
||||||
port.parse().unwrap_or_else(|err| {
|
port.parse().unwrap_or_else(|err| {
|
||||||
args_fail(&format!("Error parsing option: --devtools ({})", err))
|
args_fail(&format!("Error parsing option: --devtools ({})", err))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue