From 690b9faa5644e336d57a608110578d91c7ef9209 Mon Sep 17 00:00:00 2001 From: Florian Bartels Date: Wed, 12 Oct 2022 14:30:06 +0200 Subject: [PATCH 1/5] Show command line arguments --- src/tools/remote-test-server/src/main.rs | 25 +++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/src/tools/remote-test-server/src/main.rs b/src/tools/remote-test-server/src/main.rs index bed9d39161d..ec992da6812 100644 --- a/src/tools/remote-test-server/src/main.rs +++ b/src/tools/remote-test-server/src/main.rs @@ -74,7 +74,11 @@ impl Config { "--bind" => next_is_bind = true, "--sequential" => config.sequential = true, "--verbose" | "-v" => config.verbose = true, - arg => panic!("unknown argument: {}", arg), + "--help" | "-h" => { + show_help(); + std::process::exit(0); + } + arg => panic!("unknown argument: {}, use `--help` for known arguments", arg), } } if next_is_bind { @@ -85,6 +89,22 @@ impl Config { } } +fn show_help() { + eprintln!( + r#"Usage: + +{} [OPTIONS] + +OPTIONS: + --bind : Specify IP address and port to listen for requests, e.g. "0.0.0.0:12345" + --sequential Run only one test at a time + -v, --verbose Show status messages + -h, --help Show this help screen +"#, + std::env::args().next().unwrap() + ); +} + fn print_verbose(s: &str, conf: Config) { if conf.verbose { println!("{}", s); @@ -92,9 +112,8 @@ fn print_verbose(s: &str, conf: Config) { } fn main() { - println!("starting test server"); - let config = Config::parse_args(); + println!("starting test server"); let listener = t!(TcpListener::bind(config.bind)); let (work, tmp): (PathBuf, PathBuf) = if cfg!(target_os = "android") { From b97969799262c90d31dfc27bb6b7d4372614063f Mon Sep 17 00:00:00 2001 From: Michael Howell Date: Sun, 16 Oct 2022 16:58:55 -0700 Subject: [PATCH 2/5] rustdoc: remove unused `.sub-logo-container` DOM on non-source pages --- src/librustdoc/html/templates/page.html | 2 ++ src/test/rustdoc/logo-class-default.rs | 2 +- src/test/rustdoc/logo-class.rs | 4 ++-- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/librustdoc/html/templates/page.html b/src/librustdoc/html/templates/page.html index 6e6bb70707d..123bd576d64 100644 --- a/src/librustdoc/html/templates/page.html +++ b/src/librustdoc/html/templates/page.html @@ -103,6 +103,7 @@
{#- -#}
{#- -#}
{#- -#} + {%- if page.css_class == "source" -%} {#- -#} {%- if !layout.logo.is_empty() %} logo {#- -#} @@ -110,6 +111,7 @@ {#- -#} {%- endif -%} {#- -#} + {%- endif -%}