Skip to content

Commit

Permalink
🐛 Print help message when no subcommand provided
Browse files Browse the repository at this point in the history
  • Loading branch information
sjquant committed Sep 6, 2024
1 parent a1eae0e commit a330fb9
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/main.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use std::path::Path;

use clap::Parser;
use clap::{IntoApp, Parser};
use flopha::cli::{Cli, Commands};
use flopha::service::{last_version, next_version};

Expand All @@ -14,10 +14,12 @@ fn main() {
Some(Commands::NextVersion(args)) => {
next_version(path, args);
}
None => {}
}

if cli.version {
println!("{}", env!("CARGO_PKG_VERSION"));
None => {
if cli.version {
println!("{}", env!("CARGO_PKG_VERSION"));
} else {
Cli::command().print_help().unwrap();
}
}
}
}

0 comments on commit a330fb9

Please sign in to comment.