Skip to content

Commit fd17afc

Browse files
committed
cli: add parse function
Avoids the need to import the Parser trait.
1 parent a679ad2 commit fd17afc

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

src/cli.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,8 @@ pub struct CommandLineArgs {
3232
#[arg(long, default_value_t = 60, env = "S3_ACTIVE_STORAGE_SHUTDOWN_TIMEOUT")]
3333
pub graceful_shutdown_timeout: u64,
3434
}
35+
36+
/// Returns parsed command line arguments.
37+
pub fn parse() -> CommandLineArgs {
38+
CommandLineArgs::parse()
39+
}

src/main.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@
2222
//! * [ndarray] provides [NumPy](https://numpy.orgq)-like n-dimensional arrays used in numerical
2323
//! computation.
2424
25-
use clap::Parser;
26-
2725
mod app;
2826
mod array;
2927
mod cli;
@@ -39,7 +37,7 @@ mod validated_json;
3937
/// Application entry point
4038
#[tokio::main]
4139
async fn main() {
42-
let args = cli::CommandLineArgs::parse();
40+
let args = cli::parse();
4341
tracing::init_tracing();
4442
let service = app::service();
4543
server::serve(&args, service).await;

0 commit comments

Comments
 (0)