Skip to content

Commit

Permalink
feat: parse Clap args before starting async runtime (#690)
Browse files Browse the repository at this point in the history
This also fixes Mergify
  • Loading branch information
JarvisCraft authored Feb 18, 2024
1 parent cc80892 commit 9860a6f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .mergify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ pull_request_rules:
- base=development
actions:
queue:
method: merge
method: squash
name: dependabot-updates
14 changes: 10 additions & 4 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,21 @@ struct CommandLineOptions {
flavor: OutputFlavor,
}

fn main() {
let options = CommandLineOptions::parse();

run(options);
}

#[tokio::main(flavor = "current_thread")]
async fn main() {
let CommandLineOptions {
async fn run(
CommandLineOptions {
hostname,
port,
timeout,
flavor,
} = CommandLineOptions::parse();

}: CommandLineOptions,
) {
let hostname = hostname.as_str();

match TcpStream::connect((hostname, port)).await {
Expand Down

0 comments on commit 9860a6f

Please sign in to comment.