From 023b8068f70d6f94b432a918ecf7f09d5118ce46 Mon Sep 17 00:00:00 2001 From: Yip Coekjan <69834864+Coekjan@users.noreply.github.com> Date: Thu, 30 May 2024 16:00:10 +0800 Subject: [PATCH] Improve CLI help doc about input & output (#4282) --- crates/typst-cli/src/args.rs | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/crates/typst-cli/src/args.rs b/crates/typst-cli/src/args.rs index 22769fb2e..36fb044f7 100644 --- a/crates/typst-cli/src/args.rs +++ b/crates/typst-cli/src/args.rs @@ -71,11 +71,12 @@ pub struct CompileCommand { #[clap(flatten)] pub common: SharedArgs, - /// Path to output file (PDF, PNG, or SVG). - /// Use `-` to write output to stdout; For output formats emitting one file per page, - /// a page number template must be present if the source document renders to multiple pages. - /// Use `{p}` for page numbers, `{0p}` for zero padded page numbers, `{t}` for page count. - /// For example, `doc-page-{0p}-of-{t}.png` creates `doc-page-01-of-10.png` and so on. + /// Path to output file (PDF, PNG or SVG). Use `-` to write output to stdout. + /// + /// For output formats emitting one file per page (PNG & SVG), a page number template + /// must be present if the source document renders to multiple pages. Use `{p}` for page + /// numbers, `{0p}` for zero padded page numbers and `{t}` for page count. For example, + /// `page-{0p}-of-{t}.png` creates `page-01-of-10.png`, `page-02-of-10.png` and so on. #[clap(required_if_eq("input", "-"), value_parser = ValueParser::new(output_value_parser))] pub output: Option, @@ -169,7 +170,7 @@ pub enum SerializationFormat { /// Common arguments of compile, watch, and query. #[derive(Debug, Clone, Args)] pub struct SharedArgs { - /// Path to input Typst file, use `-` to read input from stdin + /// Path to input Typst file. Use `-` to read input from stdin #[clap(value_parser = input_value_parser)] pub input: Input,