1use clap::Parser;
2use std::path::PathBuf;
3
4#[derive(Parser, Debug, Clone)]
6#[command(name = "ncu")]
7#[command(author, version, about, long_about = None)]
8pub struct Args {
9 #[arg(short, long)]
11 pub global: bool,
12
13 #[arg(value_name = "PATH", conflicts_with = "global")]
15 pub path: Option<PathBuf>,
16
17 #[arg(short, long)]
19 pub update: bool,
20
21 #[arg(short, long)]
23 pub minor: bool,
24
25 #[arg(short, long)]
27 pub force: bool,
28
29 #[arg(short, long)]
31 pub pre_release: bool,
32}
33
34impl Args {
35 pub fn project_path(&self) -> PathBuf {
36 self.path.clone().unwrap_or_else(|| PathBuf::from("."))
37 }
38}