1use clap::{ColorChoice, Parser, Subcommand};
2
3#[cfg(feature = "cli_complation")]
4#[derive(Clone, Debug, clap::ValueEnum)]
5pub enum Shell {
6 Bash,
7 Fish,
8 Zsh,
9 Elvish,
10 Nushell,
11 #[allow(clippy::enum_variant_names)]
12 PowerShell, }
14
15#[derive(Parser)]
16#[command(name = "pkg")]
17#[command(version, about, long_about = None)] #[command(color = ColorChoice::Always)] pub struct Cli {
20 #[command(subcommand)]
21 pub command: Commands,
22}
23
24#[derive(Subcommand)]
25pub enum Commands {
26 #[command(alias = "sync", alias = "b", alias = "s")]
28 Build {
29 #[arg(short, long)]
31 update: bool,
32 },
33
34 Rebuild,
36
37 #[command(alias = "u")]
39 Update {
40 packages: Option<Vec<String>>,
42 },
43
44 Info {
46 package: Option<Vec<String>>,
48 },
49
50 Link,
52
53 Clean,
55
56 Docs,
58
59 #[cfg(feature = "cli_complation")]
60 #[command(alias = "compl")]
62 Completions {
63 shell: Shell,
65 },
66}
67
68pub fn parse_args() -> Cli {
70 Cli::parse()
71}