1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
use clap::{Parser, Subcommand};
#[derive(Parser)]
#[command(name = "dolly", about, version)]
pub struct Cli {
#[command(subcommand)]
pub command: Command,
}
#[derive(Subcommand)]
pub enum Command {
/// Clone a GitHub repository into the managed repos directory
Clone {
/// owner/repo on GitHub
name: String,
},
/// Clone, build, and install a tool
Install {
/// owner/repo on GitHub
name: String,
},
/// Update managed packages
Update {
/// Repo name (omit to update all)
repo: Option<String>,
/// Show what would be updated without doing it
#[arg(long)]
dry_run: bool,
},
/// Remove an installed package
Remove {
/// Repo name
repo: String,
/// Keep the cloned source repo
#[arg(long)]
keep_repo: bool,
},
/// List managed packages
List {
/// Show only packages with updates available
#[arg(long)]
outdated: bool,
},
/// Show details about a managed package
Info {
/// Repo name
repo: String,
},
}