Skip to content
Prev Previous commit
Next Next commit
not use deprecated code
  • Loading branch information
wendajiang committed Jul 8, 2022
commit f47b7c8688a6637d67b7ee388442ba55341d58ce
6 changes: 3 additions & 3 deletions src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use crate::{
err::Error,
flag::{Debug, Flag},
};
use clap::{crate_name, crate_version, App, AppSettings};
use clap::{crate_name, crate_version};

/// This should be called before calling any cli method or printing any output.
pub fn reset_signal_pipe_handler() {
Expand All @@ -25,7 +25,7 @@ pub fn reset_signal_pipe_handler() {
/// Get maches
pub async fn main() -> Result<(), Error> {
let _ = reset_signal_pipe_handler();
let m = App::new(crate_name!())
let m = clap::Command::new(crate_name!())
.version(crate_version!())
.about("May the Code be with You 👻")
.subcommands(vec![
Expand All @@ -38,7 +38,7 @@ pub async fn main() -> Result<(), Error> {
TestCommand::usage().display_order(7),
])
.arg(Debug::usage())
.setting(AppSettings::ArgRequiredElseHelp)
.arg_required_else_help(true)
.get_matches();

if m.contains_id("debug") {
Expand Down