diff --git a/cli/build.rs b/cli/build.rs
index b6f7d6eef..86325e1d1 100644
--- a/cli/build.rs
+++ b/cli/build.rs
@@ -7,23 +7,6 @@ use clap::{CommandFactory, ValueEnum};
use clap_complete::{generate_to, Shell};
use clap_mangen::Man;
-pub fn typst_version() -> String {
- if let Some(version) = option_env!("TYPST_VERSION") {
- return version.to_owned();
- }
-
- let pkg = env!("CARGO_PKG_VERSION");
- let hash = Command::new("git")
- .args(["rev-parse", "HEAD"])
- .output()
- .ok()
- .filter(|output| output.status.success())
- .and_then(|output| String::from_utf8(output.stdout.get(..8)?.into()).ok())
- .unwrap_or_else(|| "unknown hash".into());
-
- format!("{pkg} ({hash})")
-}
-
#[path = "src/args.rs"]
#[allow(dead_code)]
mod args;
@@ -57,3 +40,21 @@ fn main() {
}
}
}
+
+/// Also used by `args.rs`.
+fn typst_version() -> String {
+ if let Some(version) = option_env!("TYPST_VERSION") {
+ return version.to_owned();
+ }
+
+ let pkg = env!("CARGO_PKG_VERSION");
+ let hash = Command::new("git")
+ .args(["rev-parse", "HEAD"])
+ .output()
+ .ok()
+ .filter(|output| output.status.success())
+ .and_then(|output| String::from_utf8(output.stdout.get(..8)?.into()).ok())
+ .unwrap_or_else(|| "unknown hash".into());
+
+ format!("{pkg} ({hash})")
+}
diff --git a/cli/src/args.rs b/cli/src/args.rs
index 699dbb97d..7eb4f4e2d 100644
--- a/cli/src/args.rs
+++ b/cli/src/args.rs
@@ -18,7 +18,8 @@ pub struct CliArguments {
#[command(subcommand)]
pub command: Command,
- /// Sets the level of verbosity: 0 = none, 1 = warning & error, 2 = info, 3 = debug, 4 = trace
+ /// Sets the level of logging verbosity:
+ /// -v = warning & error, -vv = info, -vvv = debug, -vvvv = trace
#[clap(short, long, action = ArgAction::Count)]
pub verbosity: u8,
}
@@ -68,8 +69,7 @@ pub struct CompileCommand {
#[arg(long = "open")]
pub open: Option