forked from diesel-rs/diesel
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcli.rs
More file actions
58 lines (58 loc) · 2.01 KB
/
Copy pathcli.rs
File metadata and controls
58 lines (58 loc) · 2.01 KB
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
#[derive(StructOpt)]
#[structopt(
name = "blog",
after_help = "You can also run `blog SUBCOMMAND -h` to get more information about that subcommand."
)]
pub enum Cli {
/// Create a new wonderfully delighting blog post
#[structopt(name = "create_post")]
CreatePost {
/// The title of your post
#[structopt(long = "title")]
title: String,
},
/// Fine-tune an existing post to reach 100% reader delight
#[structopt(name = "edit_post")]
EditPost {
/// The id of the post to edit
post_id: i32,
/// Announce this piece of literary perfectionisms to the world?
#[structopt(short = "i", default_value = "false")]
publish: bool,
},
/// Get an overview of all your literary accomplishments
#[structopt(name = "all_posts")]
AllPosts {
/// The page to display
#[structopt(long = "page", default_value = "1")]
page: i64,
/// The number of posts to display per page (cannot be larger than 25)
#[structopt(long = "per-page", default_value = "1")]
per_page: Option<i64>,
},
/// Quickly add an important remark to a post
#[structopt(name = "add_comment")]
AddComment {
/// The id of the post to comment on
post_id: i32,
},
/// Edit a comment, e.g. to cite the sources of your facts
#[structopt(name = "edit_comment")]
EditComment {
/// The id of the comment to edit
comment_id: i32,
},
/// See all the instances where you were able to improve a post by adding a comment
#[structopt(name = "my_comments")]
MyComments {
/// The page to display
#[structopt(long = "page", default_value = "1")]
page: i64,
/// The number of comments to display per page (cannot be larger than 25)
#[structopt(long = "per-page", default_value = "1")]
per_page: Option<i64>,
},
/// Register as the newest member of this slightly elitist community
#[structopt(name = "register")]
Register,
}