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
|
use clap::{Args, Parser, Subcommand};
/// A command line interface to install AppImages
#[derive(Debug, Parser)]
#[command(version, about, long_about = None)]
pub struct Cli {
#[command(subcommand)]
pub command: Command,
}
#[derive(Debug, Subcommand)]
pub enum Command {
/// Installs an AppImage
#[command(name = "install", alias = "i")]
Install(InstallArgs),
/// Removes an AppImage
#[command(name = "remove", alias = "rm")]
Remove(RemoveArgs),
/// List the installed AppImages
#[command(name = "list", alias = "ls")]
List,
}
#[derive(Debug, Args)]
pub struct InstallArgs {
pub appname: String,
/// Provide a repository slug, or a direct URL to an appimage.
#[arg(long)]
pub from: String,
/// Name of the executable
#[arg(long)]
pub executable: Option<String>,
}
#[derive(Debug, Args)]
pub struct RemoveArgs {
pub appname: String,
}
|