Skip to content

Commit

Permalink
cli: display usage if no subcommand passed
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasholder committed Apr 1, 2020
1 parent 81cc46a commit 6d735db
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use fair::ProvablyFairConfig;

// TODO: refactor so that client_seed, server_see and nonce required for all games except crash
fn main() {
let matches = clap_app!(myapp =>
let app = clap_app!(myapp =>
(name: crate_name!())
(version: crate_version!())
(author: crate_authors!())
Expand Down Expand Up @@ -134,8 +134,9 @@ fn main() {
{validate_hex}
"Game hash")
)
)
.get_matches();
).setting(clap::AppSettings::ArgRequiredElseHelp);

let matches = app.get_matches();

let (game, maybe_sub_matches) = matches.subcommand();
let sub_matches = maybe_sub_matches.unwrap();
Expand Down

0 comments on commit 6d735db

Please sign in to comment.