Add support for the --no-create flag to the serve subcommand.
This commit is contained in:
parent
1aa9c92ac1
commit
026eda915c
|
@ -29,6 +29,9 @@ pub fn make_subcommand<'a, 'b>() -> App<'a, 'b> {
|
||||||
"-d, --dest-dir=[dest-dir] 'The output directory for \
|
"-d, --dest-dir=[dest-dir] 'The output directory for \
|
||||||
your book{n}(Defaults to ./book when omitted)'",
|
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("-p, --port=[port] 'Use another port{n}(Defaults to 3000)'")
|
||||||
.arg_from_usage(
|
.arg_from_usage(
|
||||||
"-w, --websocket-port=[ws-port] 'Use another port for the \
|
"-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);
|
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 port = args.value_of("port").unwrap_or("3000");
|
||||||
let ws_port = args.value_of("websocket-port").unwrap_or("3001");
|
let ws_port = args.value_of("websocket-port").unwrap_or("3001");
|
||||||
let interface = args.value_of("interface").unwrap_or("localhost");
|
let interface = args.value_of("interface").unwrap_or("localhost");
|
||||||
|
|
Loading…
Reference in New Issue