diff options
author | Gabor Javorszky <g.javorszky@f5.com> | 2024-09-16 10:20:51 +0100 |
---|---|---|
committer | Andrew Clayton <a.clayton@nginx.com> | 2024-09-16 22:52:56 +0100 |
commit | 63148a31d52e325c912fcef7d53a39a325718c99 (patch) | |
tree | 43e9c5ae6eef42f4558ad424af7ac23a287a7011 | |
parent | 3c563849f13b7948d160a71ce8d480c4bb91b8f8 (diff) | |
download | unit-63148a31d52e325c912fcef7d53a39a325718c99.tar.gz unit-63148a31d52e325c912fcef7d53a39a325718c99.tar.bz2 |
tools/unitctl: whitespace fixes
Signed-off-by: Gabor Javorszky <g.javorszky@f5.com>
-rw-r--r-- | tools/unitctl/unitctl/src/unitctl.rs | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/tools/unitctl/unitctl/src/unitctl.rs b/tools/unitctl/unitctl/src/unitctl.rs index 8db71b8f..322031cf 100644 --- a/tools/unitctl/unitctl/src/unitctl.rs +++ b/tools/unitctl/unitctl/src/unitctl.rs @@ -17,6 +17,7 @@ pub(crate) struct UnitCtl { help = "Path (unix:/var/run/unit/control.sock), tcp address with port (127.0.0.1:80), or URL" )] pub(crate) control_socket_addresses: Option<Vec<ControlSocket>>, + #[arg( required = false, default_missing_value = "1", @@ -26,6 +27,7 @@ pub(crate) struct UnitCtl { help = "Number of seconds to wait for control socket to become available" )] pub(crate) wait_time_seconds: Option<u8>, + #[arg( required = false, default_value = "3", @@ -35,6 +37,7 @@ pub(crate) struct UnitCtl { help = "Number of times to try to access control socket when waiting" )] pub(crate) wait_max_tries: Option<u8>, + #[command(subcommand)] pub(crate) command: Commands, } @@ -43,6 +46,7 @@ pub(crate) struct UnitCtl { pub(crate) enum Commands { #[command(about = "List all running Unit processes")] Instances(InstanceArgs), + #[command(about = "Open current Unit configuration in editor")] Edit { #[arg( @@ -55,11 +59,13 @@ pub(crate) enum Commands { )] output_format: OutputFormat, }, + #[command(about = "Import configuration from a directory")] Import { #[arg(required = true, help = "Directory to import from")] directory: PathBuf, }, + #[command(about = "Sends raw JSON payload to Unit")] Execute { #[arg( @@ -71,6 +77,7 @@ pub(crate) enum Commands { help = "Output format of the result" )] output_format: OutputFormat, + #[arg( required = false, global = true, @@ -79,17 +86,20 @@ pub(crate) enum Commands { help = "Input file (json, json5, cjson, hjson yaml, pem) to send to unit when applicable use - for stdin" )] input_file: Option<String>, + #[arg( - help = "HTTP method to use (GET, POST, PUT, DELETE)", - required = true, - short = 'm', - long = "http-method", - value_parser = parse_http_method, + required = true, + short = 'm', + long = "http-method", + value_parser = parse_http_method, + help = "HTTP method to use (GET, POST, PUT, DELETE)", )] method: String, + #[arg(required = true, short = 'p', long = "path")] path: String, }, + #[command(about = "Get the current status of Unit")] Status { #[arg( @@ -102,6 +112,7 @@ pub(crate) enum Commands { )] output_format: OutputFormat, }, + #[command(about = "List active listeners")] Listeners { #[arg( @@ -114,6 +125,7 @@ pub(crate) enum Commands { )] output_format: OutputFormat, }, + #[command(about = "List all configured Unit applications")] App(ApplicationArgs), |