about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--src/librustdoc/config.rs11
-rw-r--r--src/librustdoc/lib.rs10
2 files changed, 21 insertions, 0 deletions
diff --git a/src/librustdoc/config.rs b/src/librustdoc/config.rs
index 45106c5dbf6..2558f9e0d78 100644
--- a/src/librustdoc/config.rs
+++ b/src/librustdoc/config.rs
@@ -379,6 +379,17 @@ impl Options {
 
         let mut default_settings: Vec<Vec<(String, String)>> = vec![
             matches
+                .opt_str("default-theme")
+                .iter()
+                .map(|theme| {
+                    vec![
+                        ("use-system-theme".to_string(), "false".to_string()),
+                        ("theme".to_string(), theme.to_string()),
+                    ]
+                })
+                .flatten()
+                .collect(),
+            matches
                 .opt_strs("default-setting")
                 .iter()
                 .map(|s| {
diff --git a/src/librustdoc/lib.rs b/src/librustdoc/lib.rs
index 90c77488ee9..54463d5c375 100644
--- a/src/librustdoc/lib.rs
+++ b/src/librustdoc/lib.rs
@@ -269,6 +269,16 @@ fn opts() -> Vec<RustcOptGroup> {
                 "sort modules by where they appear in the program, rather than alphabetically",
             )
         }),
+        unstable("default-theme", |o| {
+            o.optopt(
+                "",
+                "default-theme",
+                "Set the default theme.  THEME should be the theme name, generally lowercase. \
+                 If an unknown default theme is specified, the builtin default is used. \
+                 The set of themes, and the rustdoc built-in default is not stable.",
+                "THEME",
+            )
+        }),
         unstable("default-setting", |o| {
             o.optmulti(
                 "",