auto merge of #5430 : Manishearth/servo/userscript_path, r=kmcallister

r? @kmcallister
This commit is contained in:
bors-servo 2015-04-01 13:15:46 -06:00
commit afbc51a746
4 changed files with 66 additions and 44 deletions

View file

@ -59,7 +59,11 @@ pub struct Opts {
pub nonincremental_layout: bool,
pub nossl: bool,
pub userscripts: bool,
/// Where to load userscripts from, if any. An empty string will load from
/// the resources/user-agent-js directory, and if the option isn't passed userscripts
/// won't be loaded
pub userscripts: Option<String>,
pub output_file: Option<String>,
pub headless: bool,
@ -183,7 +187,7 @@ pub fn default_opts() -> Opts {
layout_threads: 1,
nonincremental_layout: false,
nossl: false,
userscripts: false,
userscripts: None,
output_file: None,
headless: true,
hard_fail: true,
@ -224,7 +228,7 @@ pub fn from_cmdline_args(args: &[String]) -> bool {
getopts::optopt("y", "layout-threads", "Number of threads to use for layout", "1"),
getopts::optflag("i", "nonincremental-layout", "Enable to turn off incremental layout."),
getopts::optflag("", "no-ssl", "Disables ssl certificate verification."),
getopts::optflag("", "userscripts", "Uses userscripts in resources/user-agent-js"),
getopts::optflagopt("", "userscripts", "Uses userscripts in resources/user-agent-js, or a specified full path",""),
getopts::optflag("z", "headless", "Headless mode"),
getopts::optflag("f", "hard-fail", "Exit on task failure instead of displaying about:failure"),
getopts::optflagopt("", "devtools", "Start remote devtools server on port", "6000"),
@ -301,7 +305,6 @@ pub fn from_cmdline_args(args: &[String]) -> bool {
let nonincremental_layout = opt_match.opt_present("i");
let nossl = opt_match.opt_present("no-ssl");
let userscripts = opt_match.opt_present("userscripts");
let mut bubble_inline_sizes_separately = debug_options.contains(&"bubble-widths");
let trace_layout = debug_options.contains(&"trace-layout");
@ -337,7 +340,7 @@ pub fn from_cmdline_args(args: &[String]) -> bool {
layout_threads: layout_threads,
nonincremental_layout: nonincremental_layout,
nossl: nossl,
userscripts: userscripts,
userscripts: opt_match.opt_default("userscripts", ""),
output_file: opt_match.opt_str("o"),
headless: opt_match.opt_present("z"),
hard_fail: opt_match.opt_present("f"),