···1+use std::path::PathBuf;
2+3+#[derive(Debug, clap::Parser)]
4+pub struct Args {
5+ // clap attr matches typst
6+ #[clap(long, env = "TYPST_PACKAGE_PATH", value_name = "DIR")]
7+ pub package_path: Option<PathBuf>,
8+ #[clap(long)]
9+ #[cfg_attr(feature = "git2", clap(hide = true))]
10+ /// Path to the git binary
11+ pub git: Option<PathBuf>,
12+ #[clap(subcommand)]
13+ pub command: Subcommand,
14+}
15+16+#[derive(Debug, clap::Subcommand)]
17+pub enum Subcommand {
18+ /// Create a new local package
19+ New {
20+ /// The name of the local package
21+ name: String,
22+ },
23+ /// Print the path of a local package
24+ #[clap(name = "path")]
25+ PrintPath {
26+ /// The name of the local package
27+ name: String
28+ },
29+ /// Increase the version of a local package by one
30+ Bump {
31+ /// The name of the local package
32+ name: String,
33+ /// Increase the major instead of the minor version
34+ #[clap(long, conflicts_with = "patch")]
35+ major: bool,
36+ /// Increase the patch instead of the minor version
37+ #[clap(long)]
38+ patch: bool,
39+ },
40+}