@@ -17,6 +17,7 @@ pub(crate) struct UnitCtl {
17
17
help = "Path (unix:/var/run/unit/control.sock), tcp address with port (127.0.0.1:80), or URL"
18
18
) ]
19
19
pub ( crate ) control_socket_addresses : Option < Vec < ControlSocket > > ,
20
+
20
21
#[ arg(
21
22
required = false ,
22
23
default_missing_value = "1" ,
@@ -26,6 +27,7 @@ pub(crate) struct UnitCtl {
26
27
help = "Number of seconds to wait for control socket to become available"
27
28
) ]
28
29
pub ( crate ) wait_time_seconds : Option < u8 > ,
30
+
29
31
#[ arg(
30
32
required = false ,
31
33
default_value = "3" ,
@@ -35,6 +37,7 @@ pub(crate) struct UnitCtl {
35
37
help = "Number of times to try to access control socket when waiting"
36
38
) ]
37
39
pub ( crate ) wait_max_tries : Option < u8 > ,
40
+
38
41
#[ command( subcommand) ]
39
42
pub ( crate ) command : Commands ,
40
43
}
@@ -43,6 +46,7 @@ pub(crate) struct UnitCtl {
43
46
pub ( crate ) enum Commands {
44
47
#[ command( about = "List all running Unit processes" ) ]
45
48
Instances ( InstanceArgs ) ,
49
+
46
50
#[ command( about = "Open current Unit configuration in editor" ) ]
47
51
Edit {
48
52
#[ arg(
@@ -55,11 +59,13 @@ pub(crate) enum Commands {
55
59
) ]
56
60
output_format : OutputFormat ,
57
61
} ,
62
+
58
63
#[ command( about = "Import configuration from a directory" ) ]
59
64
Import {
60
65
#[ arg( required = true , help = "Directory to import from" ) ]
61
66
directory : PathBuf ,
62
67
} ,
68
+
63
69
#[ command( about = "Sends raw JSON payload to Unit" ) ]
64
70
Execute {
65
71
#[ arg(
@@ -71,6 +77,7 @@ pub(crate) enum Commands {
71
77
help = "Output format of the result"
72
78
) ]
73
79
output_format : OutputFormat ,
80
+
74
81
#[ arg(
75
82
required = false ,
76
83
global = true ,
@@ -79,17 +86,20 @@ pub(crate) enum Commands {
79
86
help = "Input file (json, json5, cjson, hjson yaml, pem) to send to unit when applicable use - for stdin"
80
87
) ]
81
88
input_file : Option < String > ,
89
+
82
90
#[ arg(
83
- help = "HTTP method to use (GET, POST, PUT, DELETE)" ,
84
- required = true ,
85
- short = 'm' ,
86
- long = "http-method" ,
87
- value_parser = parse_http_method ,
91
+ required = true ,
92
+ short = 'm' ,
93
+ long = "http-method" ,
94
+ value_parser = parse_http_method ,
95
+ help = "HTTP method to use (GET, POST, PUT, DELETE)" ,
88
96
) ]
89
97
method : String ,
98
+
90
99
#[ arg( required = true , short = 'p' , long = "path" ) ]
91
100
path : String ,
92
101
} ,
102
+
93
103
#[ command( about = "Get the current status of Unit" ) ]
94
104
Status {
95
105
#[ arg(
@@ -102,6 +112,7 @@ pub(crate) enum Commands {
102
112
) ]
103
113
output_format : OutputFormat ,
104
114
} ,
115
+
105
116
#[ command( about = "List active listeners" ) ]
106
117
Listeners {
107
118
#[ arg(
@@ -114,6 +125,7 @@ pub(crate) enum Commands {
114
125
) ]
115
126
output_format : OutputFormat ,
116
127
} ,
128
+
117
129
#[ command( about = "List all configured Unit applications" ) ]
118
130
App ( ApplicationArgs ) ,
119
131
0 commit comments