@@ -17,6 +17,7 @@ pub(crate) struct UnitCtl {
1717 help = "Path (unix:/var/run/unit/control.sock), tcp address with port (127.0.0.1:80), or URL"
1818 ) ]
1919 pub ( crate ) control_socket_addresses : Option < Vec < ControlSocket > > ,
20+
2021 #[ arg(
2122 required = false ,
2223 default_missing_value = "1" ,
@@ -26,6 +27,7 @@ pub(crate) struct UnitCtl {
2627 help = "Number of seconds to wait for control socket to become available"
2728 ) ]
2829 pub ( crate ) wait_time_seconds : Option < u8 > ,
30+
2931 #[ arg(
3032 required = false ,
3133 default_value = "3" ,
@@ -35,6 +37,7 @@ pub(crate) struct UnitCtl {
3537 help = "Number of times to try to access control socket when waiting"
3638 ) ]
3739 pub ( crate ) wait_max_tries : Option < u8 > ,
40+
3841 #[ command( subcommand) ]
3942 pub ( crate ) command : Commands ,
4043}
@@ -43,6 +46,7 @@ pub(crate) struct UnitCtl {
4346pub ( crate ) enum Commands {
4447 #[ command( about = "List all running Unit processes" ) ]
4548 Instances ( InstanceArgs ) ,
49+
4650 #[ command( about = "Open current Unit configuration in editor" ) ]
4751 Edit {
4852 #[ arg(
@@ -55,11 +59,13 @@ pub(crate) enum Commands {
5559 ) ]
5660 output_format : OutputFormat ,
5761 } ,
62+
5863 #[ command( about = "Import configuration from a directory" ) ]
5964 Import {
6065 #[ arg( required = true , help = "Directory to import from" ) ]
6166 directory : PathBuf ,
6267 } ,
68+
6369 #[ command( about = "Sends raw JSON payload to Unit" ) ]
6470 Execute {
6571 #[ arg(
@@ -71,6 +77,7 @@ pub(crate) enum Commands {
7177 help = "Output format of the result"
7278 ) ]
7379 output_format : OutputFormat ,
80+
7481 #[ arg(
7582 required = false ,
7683 global = true ,
@@ -79,17 +86,20 @@ pub(crate) enum Commands {
7986 help = "Input file (json, json5, cjson, hjson yaml, pem) to send to unit when applicable use - for stdin"
8087 ) ]
8188 input_file : Option < String > ,
89+
8290 #[ 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)" ,
8896 ) ]
8997 method : String ,
98+
9099 #[ arg( required = true , short = 'p' , long = "path" ) ]
91100 path : String ,
92101 } ,
102+
93103 #[ command( about = "Get the current status of Unit" ) ]
94104 Status {
95105 #[ arg(
@@ -102,6 +112,7 @@ pub(crate) enum Commands {
102112 ) ]
103113 output_format : OutputFormat ,
104114 } ,
115+
105116 #[ command( about = "List active listeners" ) ]
106117 Listeners {
107118 #[ arg(
@@ -114,6 +125,7 @@ pub(crate) enum Commands {
114125 ) ]
115126 output_format : OutputFormat ,
116127 } ,
128+
117129 #[ command( about = "List all configured Unit applications" ) ]
118130 App ( ApplicationArgs ) ,
119131
0 commit comments