]> git.lizzy.rs Git - rust.git/blob - src/librustdoc/lib.rs
Rollup merge of #49606 - varkor:pipe-repair, r=alexcrichton
[rust.git] / src / librustdoc / lib.rs
1 // Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
4 //
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 // option. This file may not be copied, modified, or distributed
9 // except according to those terms.
10
11 #![doc(html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
12        html_favicon_url = "https://doc.rust-lang.org/favicon.ico",
13        html_root_url = "https://doc.rust-lang.org/nightly/",
14        html_playground_url = "https://play.rust-lang.org/")]
15
16 #![feature(ascii_ctype)]
17 #![feature(rustc_private)]
18 #![feature(box_patterns)]
19 #![feature(box_syntax)]
20 #![feature(fs_read_write)]
21 #![feature(set_stdio)]
22 #![feature(slice_sort_by_cached_key)]
23 #![feature(test)]
24 #![feature(vec_remove_item)]
25 #![feature(entry_and_modify)]
26
27 extern crate arena;
28 extern crate getopts;
29 extern crate env_logger;
30 extern crate rustc;
31 extern crate rustc_data_structures;
32 extern crate rustc_const_math;
33 extern crate rustc_trans_utils;
34 extern crate rustc_driver;
35 extern crate rustc_resolve;
36 extern crate rustc_lint;
37 extern crate rustc_back;
38 extern crate rustc_metadata;
39 extern crate rustc_typeck;
40 extern crate serialize;
41 #[macro_use] extern crate syntax;
42 extern crate syntax_pos;
43 extern crate test as testing;
44 #[macro_use] extern crate log;
45 extern crate rustc_errors as errors;
46 extern crate pulldown_cmark;
47 extern crate tempdir;
48
49 extern crate serialize as rustc_serialize; // used by deriving
50
51 use std::collections::{BTreeMap, BTreeSet};
52 use std::default::Default;
53 use std::env;
54 use std::fmt::Display;
55 use std::io;
56 use std::io::Write;
57 use std::path::{Path, PathBuf};
58 use std::process;
59 use std::sync::mpsc::channel;
60
61 use syntax::edition::Edition;
62 use externalfiles::ExternalHtml;
63 use rustc::session::search_paths::SearchPaths;
64 use rustc::session::config::{ErrorOutputType, RustcOptGroup, Externs, CodegenOptions};
65 use rustc::session::config::{nightly_options, build_codegen_options};
66 use rustc_back::target::TargetTriple;
67
68 #[macro_use]
69 pub mod externalfiles;
70
71 pub mod clean;
72 pub mod core;
73 pub mod doctree;
74 pub mod fold;
75 pub mod html {
76     pub mod highlight;
77     pub mod escape;
78     pub mod item_type;
79     pub mod format;
80     pub mod layout;
81     pub mod markdown;
82     pub mod render;
83     pub mod toc;
84 }
85 pub mod markdown;
86 pub mod passes;
87 pub mod plugins;
88 pub mod visit_ast;
89 pub mod visit_lib;
90 pub mod test;
91 pub mod theme;
92
93 use clean::AttributesExt;
94
95 struct Output {
96     krate: clean::Crate,
97     renderinfo: html::render::RenderInfo,
98     passes: Vec<String>,
99 }
100
101 pub fn main() {
102     const STACK_SIZE: usize = 32_000_000; // 32MB
103     rustc_driver::set_sigpipe_handler();
104     env_logger::init();
105     let res = std::thread::Builder::new().stack_size(STACK_SIZE).spawn(move || {
106         syntax::with_globals(move || {
107             get_args().map(|args| main_args(&args)).unwrap_or(1)
108         })
109     }).unwrap().join().unwrap_or(101);
110     process::exit(res as i32);
111 }
112
113 fn get_args() -> Option<Vec<String>> {
114     env::args_os().enumerate()
115         .map(|(i, arg)| arg.into_string().map_err(|arg| {
116              print_error(format!("Argument {} is not valid Unicode: {:?}", i, arg));
117         }).ok())
118         .collect()
119 }
120
121 fn stable<F>(name: &'static str, f: F) -> RustcOptGroup
122     where F: Fn(&mut getopts::Options) -> &mut getopts::Options + 'static
123 {
124     RustcOptGroup::stable(name, f)
125 }
126
127 fn unstable<F>(name: &'static str, f: F) -> RustcOptGroup
128     where F: Fn(&mut getopts::Options) -> &mut getopts::Options + 'static
129 {
130     RustcOptGroup::unstable(name, f)
131 }
132
133 pub fn opts() -> Vec<RustcOptGroup> {
134     vec![
135         stable("h", |o| o.optflag("h", "help", "show this help message")),
136         stable("V", |o| o.optflag("V", "version", "print rustdoc's version")),
137         stable("v", |o| o.optflag("v", "verbose", "use verbose output")),
138         stable("r", |o| {
139             o.optopt("r", "input-format", "the input type of the specified file",
140                      "[rust]")
141         }),
142         stable("w", |o| {
143             o.optopt("w", "output-format", "the output type to write", "[html]")
144         }),
145         stable("o", |o| o.optopt("o", "output", "where to place the output", "PATH")),
146         stable("crate-name", |o| {
147             o.optopt("", "crate-name", "specify the name of this crate", "NAME")
148         }),
149         stable("L", |o| {
150             o.optmulti("L", "library-path", "directory to add to crate search path",
151                        "DIR")
152         }),
153         stable("cfg", |o| o.optmulti("", "cfg", "pass a --cfg to rustc", "")),
154         stable("extern", |o| {
155             o.optmulti("", "extern", "pass an --extern to rustc", "NAME=PATH")
156         }),
157         stable("plugin-path", |o| {
158             o.optmulti("", "plugin-path", "directory to load plugins from", "DIR")
159         }),
160         stable("C", |o| {
161             o.optmulti("C", "codegen", "pass a codegen option to rustc", "OPT[=VALUE]")
162         }),
163         stable("passes", |o| {
164             o.optmulti("", "passes",
165                        "list of passes to also run, you might want \
166                         to pass it multiple times; a value of `list` \
167                         will print available passes",
168                        "PASSES")
169         }),
170         stable("plugins", |o| {
171             o.optmulti("", "plugins", "space separated list of plugins to also load",
172                        "PLUGINS")
173         }),
174         stable("no-default", |o| {
175             o.optflag("", "no-defaults", "don't run the default passes")
176         }),
177         stable("document-private-items", |o| {
178             o.optflag("", "document-private-items", "document private items")
179         }),
180         stable("test", |o| o.optflag("", "test", "run code examples as tests")),
181         stable("test-args", |o| {
182             o.optmulti("", "test-args", "arguments to pass to the test runner",
183                        "ARGS")
184         }),
185         stable("target", |o| o.optopt("", "target", "target triple to document", "TRIPLE")),
186         stable("markdown-css", |o| {
187             o.optmulti("", "markdown-css",
188                        "CSS files to include via <link> in a rendered Markdown file",
189                        "FILES")
190         }),
191         stable("html-in-header", |o|  {
192             o.optmulti("", "html-in-header",
193                        "files to include inline in the <head> section of a rendered Markdown file \
194                         or generated documentation",
195                        "FILES")
196         }),
197         stable("html-before-content", |o| {
198             o.optmulti("", "html-before-content",
199                        "files to include inline between <body> and the content of a rendered \
200                         Markdown file or generated documentation",
201                        "FILES")
202         }),
203         stable("html-after-content", |o| {
204             o.optmulti("", "html-after-content",
205                        "files to include inline between the content and </body> of a rendered \
206                         Markdown file or generated documentation",
207                        "FILES")
208         }),
209         unstable("markdown-before-content", |o| {
210             o.optmulti("", "markdown-before-content",
211                        "files to include inline between <body> and the content of a rendered \
212                         Markdown file or generated documentation",
213                        "FILES")
214         }),
215         unstable("markdown-after-content", |o| {
216             o.optmulti("", "markdown-after-content",
217                        "files to include inline between the content and </body> of a rendered \
218                         Markdown file or generated documentation",
219                        "FILES")
220         }),
221         stable("markdown-playground-url", |o| {
222             o.optopt("", "markdown-playground-url",
223                      "URL to send code snippets to", "URL")
224         }),
225         stable("markdown-no-toc", |o| {
226             o.optflag("", "markdown-no-toc", "don't include table of contents")
227         }),
228         stable("e", |o| {
229             o.optopt("e", "extend-css",
230                      "To add some CSS rules with a given file to generate doc with your \
231                       own theme. However, your theme might break if the rustdoc's generated HTML \
232                       changes, so be careful!", "PATH")
233         }),
234         unstable("Z", |o| {
235             o.optmulti("Z", "",
236                        "internal and debugging options (only on nightly build)", "FLAG")
237         }),
238         stable("sysroot", |o| {
239             o.optopt("", "sysroot", "Override the system root", "PATH")
240         }),
241         unstable("playground-url", |o| {
242             o.optopt("", "playground-url",
243                      "URL to send code snippets to, may be reset by --markdown-playground-url \
244                       or `#![doc(html_playground_url=...)]`",
245                      "URL")
246         }),
247         unstable("display-warnings", |o| {
248             o.optflag("", "display-warnings", "to print code warnings when testing doc")
249         }),
250         unstable("crate-version", |o| {
251             o.optopt("", "crate-version", "crate version to print into documentation", "VERSION")
252         }),
253         unstable("linker", |o| {
254             o.optopt("", "linker", "linker used for building executable test code", "PATH")
255         }),
256         unstable("sort-modules-by-appearance", |o| {
257             o.optflag("", "sort-modules-by-appearance", "sort modules by where they appear in the \
258                                                          program, rather than alphabetically")
259         }),
260         unstable("themes", |o| {
261             o.optmulti("", "themes",
262                        "additional themes which will be added to the generated docs",
263                        "FILES")
264         }),
265         unstable("theme-checker", |o| {
266             o.optmulti("", "theme-checker",
267                        "check if given theme is valid",
268                        "FILES")
269         }),
270         unstable("resource-suffix", |o| {
271             o.optopt("",
272                      "resource-suffix",
273                      "suffix to add to CSS and JavaScript files, e.g. \"light.css\" will become \
274                       \"light-suffix.css\"",
275                      "PATH")
276         }),
277         unstable("edition", |o| {
278             o.optopt("", "edition",
279                      "edition to use when compiling rust code (default: 2015)",
280                      "EDITION")
281         }),
282     ]
283 }
284
285 pub fn usage(argv0: &str) {
286     let mut options = getopts::Options::new();
287     for option in opts() {
288         (option.apply)(&mut options);
289     }
290     println!("{}", options.usage(&format!("{} [options] <input>", argv0)));
291 }
292
293 pub fn main_args(args: &[String]) -> isize {
294     let mut options = getopts::Options::new();
295     for option in opts() {
296         (option.apply)(&mut options);
297     }
298     let matches = match options.parse(&args[1..]) {
299         Ok(m) => m,
300         Err(err) => {
301             print_error(err);
302             return 1;
303         }
304     };
305     // Check for unstable options.
306     nightly_options::check_nightly_options(&matches, &opts());
307
308     // check for deprecated options
309     check_deprecated_options(&matches);
310
311     if matches.opt_present("h") || matches.opt_present("help") {
312         usage("rustdoc");
313         return 0;
314     } else if matches.opt_present("version") {
315         rustc_driver::version("rustdoc", &matches);
316         return 0;
317     }
318
319     if matches.opt_strs("passes") == ["list"] {
320         println!("Available passes for running rustdoc:");
321         for &(name, _, description) in passes::PASSES {
322             println!("{:>20} - {}", name, description);
323         }
324         println!("\nDefault passes for rustdoc:");
325         for &name in passes::DEFAULT_PASSES {
326             println!("{:>20}", name);
327         }
328         return 0;
329     }
330
331     let to_check = matches.opt_strs("theme-checker");
332     if !to_check.is_empty() {
333         let paths = theme::load_css_paths(include_bytes!("html/static/themes/light.css"));
334         let mut errors = 0;
335
336         println!("rustdoc: [theme-checker] Starting tests!");
337         for theme_file in to_check.iter() {
338             print!(" - Checking \"{}\"...", theme_file);
339             let (success, differences) = theme::test_theme_against(theme_file, &paths);
340             if !differences.is_empty() || !success {
341                 println!(" FAILED");
342                 errors += 1;
343                 if !differences.is_empty() {
344                     println!("{}", differences.join("\n"));
345                 }
346             } else {
347                 println!(" OK");
348             }
349         }
350         if errors != 0 {
351             return 1;
352         }
353         return 0;
354     }
355
356     if matches.free.is_empty() {
357         print_error("missing file operand");
358         return 1;
359     }
360     if matches.free.len() > 1 {
361         print_error("too many file operands");
362         return 1;
363     }
364     let input = &matches.free[0];
365
366     let mut libs = SearchPaths::new();
367     for s in &matches.opt_strs("L") {
368         libs.add_path(s, ErrorOutputType::default());
369     }
370     let externs = match parse_externs(&matches) {
371         Ok(ex) => ex,
372         Err(err) => {
373             print_error(err);
374             return 1;
375         }
376     };
377
378     let test_args = matches.opt_strs("test-args");
379     let test_args: Vec<String> = test_args.iter()
380                                           .flat_map(|s| s.split_whitespace())
381                                           .map(|s| s.to_string())
382                                           .collect();
383
384     let should_test = matches.opt_present("test");
385     let markdown_input = Path::new(input).extension()
386         .map_or(false, |e| e == "md" || e == "markdown");
387
388     let output = matches.opt_str("o").map(|s| PathBuf::from(&s));
389     let css_file_extension = matches.opt_str("e").map(|s| PathBuf::from(&s));
390     let cfgs = matches.opt_strs("cfg");
391
392     if let Some(ref p) = css_file_extension {
393         if !p.is_file() {
394             writeln!(
395                 &mut io::stderr(),
396                 "rustdoc: option --extend-css argument must be a file."
397             ).unwrap();
398             return 1;
399         }
400     }
401
402     let mut themes = Vec::new();
403     if matches.opt_present("themes") {
404         let paths = theme::load_css_paths(include_bytes!("html/static/themes/light.css"));
405
406         for (theme_file, theme_s) in matches.opt_strs("themes")
407                                             .iter()
408                                             .map(|s| (PathBuf::from(&s), s.to_owned())) {
409             if !theme_file.is_file() {
410                 println!("rustdoc: option --themes arguments must all be files");
411                 return 1;
412             }
413             let (success, ret) = theme::test_theme_against(&theme_file, &paths);
414             if !success || !ret.is_empty() {
415                 println!("rustdoc: invalid theme: \"{}\"", theme_s);
416                 println!("         Check what's wrong with the \"theme-checker\" option");
417                 return 1;
418             }
419             themes.push(theme_file);
420         }
421     }
422
423     let external_html = match ExternalHtml::load(
424             &matches.opt_strs("html-in-header"),
425             &matches.opt_strs("html-before-content"),
426             &matches.opt_strs("html-after-content"),
427             &matches.opt_strs("markdown-before-content"),
428             &matches.opt_strs("markdown-after-content")) {
429         Some(eh) => eh,
430         None => return 3,
431     };
432     let crate_name = matches.opt_str("crate-name");
433     let playground_url = matches.opt_str("playground-url");
434     let maybe_sysroot = matches.opt_str("sysroot").map(PathBuf::from);
435     let display_warnings = matches.opt_present("display-warnings");
436     let linker = matches.opt_str("linker").map(PathBuf::from);
437     let sort_modules_alphabetically = !matches.opt_present("sort-modules-by-appearance");
438     let resource_suffix = matches.opt_str("resource-suffix");
439
440     let edition = matches.opt_str("edition").unwrap_or("2015".to_string());
441     let edition = match edition.parse() {
442         Ok(e) => e,
443         Err(_) => {
444             print_error("could not parse edition");
445             return 1;
446         }
447     };
448
449     let cg = build_codegen_options(&matches, ErrorOutputType::default());
450
451     match (should_test, markdown_input) {
452         (true, true) => {
453             return markdown::test(input, cfgs, libs, externs, test_args, maybe_sysroot,
454                                   display_warnings, linker, edition, cg)
455         }
456         (true, false) => {
457             return test::run(Path::new(input), cfgs, libs, externs, test_args, crate_name,
458                              maybe_sysroot, display_warnings, linker, edition, cg)
459         }
460         (false, true) => return markdown::render(Path::new(input),
461                                                  output.unwrap_or(PathBuf::from("doc")),
462                                                  &matches, &external_html,
463                                                  !matches.opt_present("markdown-no-toc")),
464         (false, false) => {}
465     }
466
467     let output_format = matches.opt_str("w");
468     let res = acquire_input(PathBuf::from(input), externs, edition, cg, &matches, move |out| {
469         let Output { krate, passes, renderinfo } = out;
470         info!("going to format");
471         match output_format.as_ref().map(|s| &**s) {
472             Some("html") | None => {
473                 html::render::run(krate, &external_html, playground_url,
474                                   output.unwrap_or(PathBuf::from("doc")),
475                                   resource_suffix.unwrap_or(String::new()),
476                                   passes.into_iter().collect(),
477                                   css_file_extension,
478                                   renderinfo,
479                                   sort_modules_alphabetically,
480                                   themes)
481                     .expect("failed to generate documentation");
482                 0
483             }
484             Some(s) => {
485                 print_error(format!("unknown output format: {}", s));
486                 1
487             }
488         }
489     });
490     res.unwrap_or_else(|s| {
491         print_error(format!("input error: {}", s));
492         1
493     })
494 }
495
496 /// Prints an uniformized error message on the standard error output
497 fn print_error<T>(error_message: T) where T: Display {
498     writeln!(
499         &mut io::stderr(),
500         "rustdoc: {}\nTry 'rustdoc --help' for more information.",
501         error_message
502     ).unwrap();
503 }
504
505 /// Looks inside the command line arguments to extract the relevant input format
506 /// and files and then generates the necessary rustdoc output for formatting.
507 fn acquire_input<R, F>(input: PathBuf,
508                        externs: Externs,
509                        edition: Edition,
510                        cg: CodegenOptions,
511                        matches: &getopts::Matches,
512                        f: F)
513                        -> Result<R, String>
514 where R: 'static + Send, F: 'static + Send + FnOnce(Output) -> R {
515     match matches.opt_str("r").as_ref().map(|s| &**s) {
516         Some("rust") => Ok(rust_input(input, externs, edition, cg, matches, f)),
517         Some(s) => Err(format!("unknown input format: {}", s)),
518         None => Ok(rust_input(input, externs, edition, cg, matches, f))
519     }
520 }
521
522 /// Extracts `--extern CRATE=PATH` arguments from `matches` and
523 /// returns a map mapping crate names to their paths or else an
524 /// error message.
525 fn parse_externs(matches: &getopts::Matches) -> Result<Externs, String> {
526     let mut externs = BTreeMap::new();
527     for arg in &matches.opt_strs("extern") {
528         let mut parts = arg.splitn(2, '=');
529         let name = parts.next().ok_or("--extern value must not be empty".to_string())?;
530         let location = parts.next()
531                                  .ok_or("--extern value must be of the format `foo=bar`"
532                                     .to_string())?;
533         let name = name.to_string();
534         externs.entry(name).or_insert_with(BTreeSet::new).insert(location.to_string());
535     }
536     Ok(Externs::new(externs))
537 }
538
539 /// Interprets the input file as a rust source file, passing it through the
540 /// compiler all the way through the analysis passes. The rustdoc output is then
541 /// generated from the cleaned AST of the crate.
542 ///
543 /// This form of input will run all of the plug/cleaning passes
544 fn rust_input<R, F>(cratefile: PathBuf,
545                     externs: Externs,
546                     edition: Edition,
547                     cg: CodegenOptions,
548                     matches: &getopts::Matches,
549                     f: F) -> R
550 where R: 'static + Send,
551       F: 'static + Send + FnOnce(Output) -> R
552 {
553     let mut default_passes = !matches.opt_present("no-defaults");
554     let mut passes = matches.opt_strs("passes");
555     let mut plugins = matches.opt_strs("plugins");
556
557     // We hardcode in the passes here, as this is a new flag and we
558     // are generally deprecating passes.
559     if matches.opt_present("document-private-items") {
560         default_passes = false;
561
562         passes = vec![
563             String::from("collapse-docs"),
564             String::from("unindent-comments"),
565         ];
566     }
567
568     // First, parse the crate and extract all relevant information.
569     let mut paths = SearchPaths::new();
570     for s in &matches.opt_strs("L") {
571         paths.add_path(s, ErrorOutputType::default());
572     }
573     let cfgs = matches.opt_strs("cfg");
574     let triple = matches.opt_str("target").map(|target| {
575         if target.ends_with(".json") {
576             TargetTriple::TargetPath(PathBuf::from(target))
577         } else {
578             TargetTriple::TargetTriple(target)
579         }
580     });
581     let maybe_sysroot = matches.opt_str("sysroot").map(PathBuf::from);
582     let crate_name = matches.opt_str("crate-name");
583     let crate_version = matches.opt_str("crate-version");
584     let plugin_path = matches.opt_str("plugin-path");
585
586     info!("starting to run rustc");
587     let display_warnings = matches.opt_present("display-warnings");
588
589     let force_unstable_if_unmarked = matches.opt_strs("Z").iter().any(|x| {
590         *x == "force-unstable-if-unmarked"
591     });
592
593     let (tx, rx) = channel();
594
595     rustc_driver::monitor(move || syntax::with_globals(move || {
596         use rustc::session::config::Input;
597
598         let (mut krate, renderinfo) =
599             core::run_core(paths, cfgs, externs, Input::File(cratefile), triple, maybe_sysroot,
600                            display_warnings, crate_name.clone(),
601                            force_unstable_if_unmarked, edition, cg);
602
603         info!("finished with rustc");
604
605         if let Some(name) = crate_name {
606             krate.name = name
607         }
608
609         krate.version = crate_version;
610
611         // Process all of the crate attributes, extracting plugin metadata along
612         // with the passes which we are supposed to run.
613         for attr in krate.module.as_ref().unwrap().attrs.lists("doc") {
614             let name = attr.name().map(|s| s.as_str());
615             let name = name.as_ref().map(|s| &s[..]);
616             if attr.is_word() {
617                 if name == Some("no_default_passes") {
618                     default_passes = false;
619                 }
620             } else if let Some(value) = attr.value_str() {
621                 let sink = match name {
622                     Some("passes") => &mut passes,
623                     Some("plugins") => &mut plugins,
624                     _ => continue,
625                 };
626                 for p in value.as_str().split_whitespace() {
627                     sink.push(p.to_string());
628                 }
629             }
630         }
631
632         if default_passes {
633             for name in passes::DEFAULT_PASSES.iter().rev() {
634                 passes.insert(0, name.to_string());
635             }
636         }
637
638         // Load all plugins/passes into a PluginManager
639         let path = plugin_path.unwrap_or("/tmp/rustdoc/plugins".to_string());
640         let mut pm = plugins::PluginManager::new(PathBuf::from(path));
641         for pass in &passes {
642             let plugin = match passes::PASSES.iter()
643                                              .position(|&(p, ..)| {
644                                                  p == *pass
645                                              }) {
646                 Some(i) => passes::PASSES[i].1,
647                 None => {
648                     error!("unknown pass {}, skipping", *pass);
649                     continue
650                 },
651             };
652             pm.add_plugin(plugin);
653         }
654         info!("loading plugins...");
655         for pname in plugins {
656             pm.load_plugin(pname);
657         }
658
659         // Run everything!
660         info!("Executing passes/plugins");
661         let krate = pm.run_plugins(krate);
662
663         tx.send(f(Output { krate: krate, renderinfo: renderinfo, passes: passes })).unwrap();
664     }));
665     rx.recv().unwrap()
666 }
667
668 /// Prints deprecation warnings for deprecated options
669 fn check_deprecated_options(matches: &getopts::Matches) {
670     let deprecated_flags = [
671        "input-format",
672        "output-format",
673        "plugin-path",
674        "plugins",
675        "no-defaults",
676        "passes",
677     ];
678
679     for flag in deprecated_flags.into_iter() {
680         if matches.opt_present(flag) {
681             eprintln!("WARNING: the '{}' flag is considered deprecated", flag);
682             eprintln!("WARNING: please see https://github.com/rust-lang/rust/issues/44136");
683         }
684     }
685
686     if matches.opt_present("no-defaults") {
687         eprintln!("WARNING: (you may want to use --document-private-items)");
688     }
689 }