@@ -4,38 +4,40 @@ use clap::Parser;
4
4
pub struct Opt {
5
5
#[ arg( verbatim_doc_comment) ]
6
6
/// Show title and content of a specific post
7
+ /// Example: cnb --id 114514 post --show
7
8
/// You should also specify the id of post via option --id
8
9
#[ arg( long) ]
9
10
#[ arg( short = 's' ) ]
10
11
pub show : bool ,
11
12
12
13
#[ arg( verbatim_doc_comment) ]
13
14
/// Show metadata of a specific post
15
+ /// Example: cnb --id 114514 post --show-meta
14
16
/// You should also specify the id of post via option --id
15
17
#[ arg( long) ]
16
18
#[ arg( short = 'm' ) ]
17
19
pub show_meta : bool ,
18
20
19
21
#[ arg( verbatim_doc_comment) ]
20
22
/// Show post list, order by time in DESC
23
+ /// Example: cnb post --list
21
24
/// <LENGTH> should in range [0,100]
22
25
/// If <LENGTH> greater than 100, it will be set to 100
23
26
#[ arg( long) ]
24
27
#[ arg( short = 'l' ) ]
25
- #[ arg( default_missing_value = "8" ) ]
26
- #[ arg( value_name = "LENGTH" ) ]
27
28
pub list : bool ,
28
29
29
30
#[ arg( verbatim_doc_comment) ]
30
31
/// Delete post
32
+ /// Example: cnb --id 114514 post --delete
31
33
/// You should also specify the id of post via option --id
32
34
#[ arg( long) ]
33
35
#[ arg( visible_alias = "del" ) ]
34
36
pub delete : bool ,
35
37
36
38
#[ arg( verbatim_doc_comment) ]
37
39
/// Search post by keyword and output the post id list that matches
38
- /// Example: cnb post --search FOO
40
+ /// Example: cnb post --search 'Hello world'
39
41
#[ arg( long) ]
40
42
#[ arg( value_name = "KEYWORD" ) ]
41
43
pub search : Option < String > ,
0 commit comments