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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
// SPDX-FileCopyrightText: 2022 Aurélien Gâteau <mail@agateau.com>
//
// SPDX-License-Identifier: GPL-3.0-or-later
use clap::{Parser, Subcommand};
/// This file must build standalone because it's used by `build.rs` to generate shell
/// auto-completion files
#[derive(Debug, Parser)]
#[command(name = "clyde", version, about)]
pub struct Cli {
#[command(subcommand)]
pub command: Command,
}
#[derive(Debug, Subcommand)]
pub enum Command {
/// Setup Clyde
Setup {
/// Update the activation scripts of an existing installation.
#[arg(short, long)]
update_scripts: bool,
/// URL of the Git repository to use for the store.
#[arg(long = "url")]
store_url: Option<String>,
},
/// Update Clyde store
Update {},
/// Install applications
Install {
/// Uninstall then reinstall already installed packages
#[arg(short, long)]
reinstall: bool,
/// Application name, optionally suffixed with @version
///
/// @version must follow Cargo's interpretation of Semantic Versioning:
/// <https://doc.rust-lang.org/cargo/reference/specifying-dependencies.html>
#[arg(required = true, value_name = "APPLICATION_NAME")]
package_names: Vec<String>,
},
/// Uninstall applications (alias: remove)
#[command(alias("remove"))]
Uninstall {
/// Application name
#[arg(required = true, value_name = "APPLICATION_NAME")]
package_names: Vec<String>,
},
/// Show details about an application
Show {
/// List application files instead of showing information
#[arg(short, long)]
list: bool,
/// Use JSON output
#[arg(short, long)]
json: bool,
/// Application name
package_name: String,
},
/// Search for available applications
Search {
/// Search query
query: String,
},
/// Read documentation files provided by an application
Doc {
/// Application name
package_name: String,
},
/// List installed applications
List {
/// Use JSON output
#[arg(short, long)]
json: bool,
},
/// Upgrade all installed applications, enforcing pinning
Upgrade {},
}