diff --git a/src/bin/serve.rs b/src/bin/serve.rs index 87099411..87c26b01 100644 --- a/src/bin/serve.rs +++ b/src/bin/serve.rs @@ -29,6 +29,9 @@ pub fn make_subcommand<'a, 'b>() -> App<'a, 'b> { "-d, --dest-dir=[dest-dir] 'The output directory for \ your book{n}(Defaults to ./book when omitted)'", ) + .arg_from_usage( + "--no-create 'Will not create non-existent files linked from SUMMARY.md'", + ) .arg_from_usage("-p, --port=[port] 'Use another port{n}(Defaults to 3000)'") .arg_from_usage( "-w, --websocket-port=[ws-port] 'Use another port for the \ @@ -55,6 +58,10 @@ pub fn execute(args: &ArgMatches) -> Result<()> { book.config.book.build_dir = PathBuf::from(dest_dir); } + if args.is_present("no-create") { + book.create_missing = false; + } + let port = args.value_of("port").unwrap_or("3000"); let ws_port = args.value_of("websocket-port").unwrap_or("3001"); let interface = args.value_of("interface").unwrap_or("localhost");