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 crate::common::{Handler, MimeOrExtension, UserPath};
#[derive(clap::Clap)]
#[clap(global_setting = clap::AppSettings::DeriveDisplayOrder)]
#[clap(global_setting = clap::AppSettings::DisableHelpSubcommand)]
#[clap(version = clap::crate_version!())]
pub enum Cmd {
/// List default apps and the associated handlers
List {
#[clap(long, short)]
all: bool,
},
/// Open a path/URL with its default handler
Open {
#[clap(required = true)]
paths: Vec<UserPath>,
},
/// Set the default handler for mime/extension
Set {
mime: MimeOrExtension,
handler: Handler,
},
/// Unset the default handler for mime/extension
Unset { mime: MimeOrExtension },
/// Launch the handler for specified extension/mime with optional arguments
Launch {
mime: MimeOrExtension,
args: Vec<UserPath>,
},
/// Get handler for this mime/extension
Get {
#[clap(long)]
json: bool,
mime: MimeOrExtension,
},
/// Add a handler for given mime/extension
/// Note that the first handler is the default
Add {
mime: MimeOrExtension,
handler: Handler,
},
#[clap(setting = clap::AppSettings::Hidden)]
Autocomplete {
#[clap(short)]
desktop_files: bool,
#[clap(short)]
mimes: bool,
},
}