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
use clap::Subcommand;
#[derive(Debug, Subcommand)]
pub enum Weblog {
/// Get a specific weblog entry for an omg.lol address
Get {
/// ID of the weblog entry to get
id: String,
},
/// Get the latest weblog entry for an omg.lol address
Latest,
/// Get all weblog entries for an omg.lol address
GetAll,
/// Create a new weblog entry for an omg.lol address
Create {
/// Content for the weblog entry
content: String,
},
/// Delete a weblog entry for an omg.lol address
Delete {
/// ID of the weblog entry to delete
id: String,
},
/// Get weblog configuration for an omg.lol address
GetConfig,
/// Update weblog configuration for an omg.lol address
SetConfig {
/// Content for the weblog configuration entry
content: String,
},
/// Get the weblog template for an omg.lol address
GetTemplate,
/// Update the weblog template for an omg.lol address
SetTemplate {
/// Content for the weblog template entry
content: String,
},
}
impl Weblog {
pub fn process(&self, _address: &str) {
match self {
Weblog::Get { id: _ } => todo!(),
Weblog::Latest => todo!(),
Weblog::GetAll => todo!(),
Weblog::Create { content: _ } => todo!(),
Weblog::Delete { id: _ } => todo!(),
Weblog::GetConfig => todo!(),
Weblog::SetConfig { content: _ } => todo!(),
Weblog::GetTemplate => todo!(),
Weblog::SetTemplate { content: _ } => todo!(),
}
}
}