Skip to content

Commit

Permalink
tools/unitctl: whitespace fixes
Browse files Browse the repository at this point in the history
Signed-off-by: Gabor Javorszky <g.javorszky@f5.com>
  • Loading branch information
javorszky authored and ac000 committed Sep 16, 2024
1 parent 3c56384 commit 63148a3
Showing 1 changed file with 17 additions and 5 deletions.
22 changes: 17 additions & 5 deletions tools/unitctl/unitctl/src/unitctl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand All @@ -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,
}
Expand All @@ -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(
Expand All @@ -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(
Expand All @@ -71,6 +77,7 @@ pub(crate) enum Commands {
help = "Output format of the result"
)]
output_format: OutputFormat,

#[arg(
required = false,
global = true,
Expand All @@ -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(
Expand All @@ -102,6 +112,7 @@ pub(crate) enum Commands {
)]
output_format: OutputFormat,
},

#[command(about = "List active listeners")]
Listeners {
#[arg(
Expand All @@ -114,6 +125,7 @@ pub(crate) enum Commands {
)]
output_format: OutputFormat,
},

#[command(about = "List all configured Unit applications")]
App(ApplicationArgs),

Expand Down

0 comments on commit 63148a3

Please sign in to comment.