typst local package (tlp) manager
at main 48 lines 1.3 kB view raw
1use std::path::PathBuf; 2 3#[derive(Debug, clap::Parser)] 4pub 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)] 17pub enum Subcommand { 18 /// Create a new local package 19 New { 20 /// The name of the local package 21 name: String, 22 }, 23 /// Initialize a local package 24 Init {}, 25 /// Print the path of a local package 26 #[clap(name = "path")] 27 PrintPath { 28 /// The name of the local package 29 name: String, 30 }, 31 /// Increase the version of a local package by one 32 Bump { 33 /// The name of the local package 34 name: String, 35 /// Increase the major instead of the minor version 36 #[clap(long, conflicts_with = "patch")] 37 major: bool, 38 /// Increase the patch instead of the minor version 39 #[clap(long)] 40 patch: bool, 41 }, 42 /// Remove a local package 43 #[clap(name = "rm")] 44 Remove { 45 /// The name of the local package 46 name: String, 47 }, 48}