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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
use clap::{Command, Arg};
pub fn get_app<'a, 'b>(version: &'a str) -> Command {
Command::new("podcast")
.version(version)
.author("Nathan J. <njaremko@gmail.com>")
.about("A command line podcast manager")
.arg(
Arg::new("quiet")
.short('q')
.long("quiet")
.help("Output less stuff")
.required(false),
)
.subcommand(
Command::new("download")
.about("download episodes of podcast")
.arg(
Arg::new("PODCAST")
.help("Regex for subscribed podcast")
.required(true)
.index(1),
)
.arg(
Arg::new("EPISODE")
.required(false)
.help("Episode index")
.index(2),
)
.arg(
Arg::new("latest")
.short('l')
.long("latest")
.value_name("LATEST")
.help("Downloads this many of the latest episodes")
.takes_value(true)
.required(false),
)
.arg(
Arg::new("name")
.short('e')
.long("episode")
.help("Download using episode name instead of index number")
.required(false),
)
.arg(
Arg::new("all")
.short('a')
.long("all")
.help("Download all matching episodes")
.required(false),
),
)
.subcommand(
Command::new("ls")
.about("list episodes of podcast")
.arg(
Arg::new("PODCAST")
.help("Regex for subscribed podcast")
.index(1),
),
)
.subcommand(
Command::new("list")
.about("list episodes of podcast")
.arg(
Arg::new("PODCAST")
.help("Regex for subscribed podcast")
.index(1),
),
)
.subcommand(
Command::new("play")
.about("play an episode")
.arg(
Arg::new("PODCAST")
.help("Regex for subscribed podcast")
.required(true)
.index(1),
)
.arg(
Arg::new("EPISODE")
.help("Episode index")
.required(false)
.index(2),
)
.arg(
Arg::new("name")
.short('e')
.long("episode")
.help("Play using episode name instead of index number")
.required(false),
),
)
.subcommand(
Command::new("search")
.about("searches for podcasts")
.arg(
Arg::new("debug")
.short('d')
.help("print debug information verbosely"),
)
.arg(
Arg::new("PODCAST")
.help("Regex for subscribed podcast")
.required(true)
.index(1)
.multiple_occurrences(true),
),
)
.subcommand(
Command::new("subscribe")
.about("subscribes to a podcast RSS feed")
.arg(
Arg::new("URL")
.help("URL to RSS feed")
.required(true)
.index(1),
),
)
.subcommand(
Command::new("sub")
.about("subscribes to a podcast RSS feed")
.arg(
Arg::new("URL")
.help("URL to RSS feed")
.required(true)
.index(1),
),
)
.subcommand(Command::new("refresh").about("refresh subscribed podcasts"))
.subcommand(Command::new("update").about("check for updates"))
.subcommand(
Command::new("rm")
.about("unsubscribe from a podcast")
.arg(Arg::new("PODCAST").help("Podcast to delete").index(1)),
)
.subcommand(
Command::new("completion")
.about("install shell completion")
.arg(
Arg::new("SHELL")
.help("Shell to print completion for")
.index(1),
),
)
}