cli_rs: fix clap 3.1 warnings

Summary: A large number of things got deprecated, let's follow the recommendations.

Reviewed By: zertosh

Differential Revision: D34467979

fbshipit-source-id: fba2a95c1e4a0de73100cf7f97541ac604b1cdb1
This commit is contained in:
Xavier Deguillard 2022-02-25 16:43:44 -08:00 committed by Facebook GitHub Bot
parent 7120d3f267
commit 4fdfbd69c5
3 changed files with 6 additions and 6 deletions

View File

@ -8,7 +8,7 @@
//! edenfsctl config
use async_trait::async_trait;
use clap::{AppSettings, Parser};
use clap::Parser;
use edenfs_client::EdenFsInstance;
use edenfs_error::Result;
@ -21,7 +21,7 @@ mod compact_local_storage;
#[derive(Parser, Debug)]
#[clap(
about = "Internal commands for examining eden state",
setting = AppSettings::DisableHelpFlag,
disable_help_flag = true
)]
pub struct DebugCmd {
#[clap(subcommand)]

View File

@ -9,7 +9,7 @@ use std::path::PathBuf;
use anyhow::Context;
use async_trait::async_trait;
use clap::{AppSettings, Parser};
use clap::Parser;
use tracing::{event, Level};
use edenfs_client::EdenFsInstance;
@ -42,8 +42,8 @@ type ExitCode = i32;
#[derive(Parser, Debug)]
#[clap(
name = "edenfsctl",
setting = AppSettings::DisableVersionFlag,
setting = AppSettings::DisableHelpFlag,
disable_version_flag = true,
disable_help_flag = true
)]
pub struct MainCommand {
/// The path to the directory where edenfs stores its internal state.

View File

@ -99,7 +99,7 @@ fn wrapper_main() -> Result<i32> {
// help flag has been disabled for the main command and debug subcommand so they
// will fallback correct while we still show help message for enabled commands
// correctly.
Err(e) if e.kind == clap::ErrorKind::DisplayHelp => e.exit(),
Err(e) if e.kind() == clap::ErrorKind::DisplayHelp => e.exit(),
Err(_) => fallback(),
}
}