Skip to content

Commit

Permalink
fix clap warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
Byron committed Feb 21, 2022
1 parent bf52bff commit aa51e05
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 12 deletions.
8 changes: 3 additions & 5 deletions cargo-smart-release/src/cli/options.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
use clap::AppSettings;

#[derive(clap::Parser)]
#[clap(setting = AppSettings::SubcommandRequired)]
#[clap(setting = AppSettings::DisableHelpSubcommand)]
#[clap(setting = AppSettings::DisableVersionFlag)]
#[clap(subcommand_required = true)]
#[clap(disable_help_subcommand = true)]
#[clap(disable_version_flag = true)]
#[clap(bin_name = "cargo")]
/// Release workspace crates fearlessly.
///
Expand Down
4 changes: 2 additions & 2 deletions src/plumbing/options.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
use clap::AppSettings;
use gitoxide_core as core;

#[derive(Debug, clap::Parser)]
#[clap(name = "gix-plumbing", about = "The git underworld", version = clap::crate_version!())]
#[clap(setting = AppSettings::SubcommandRequiredElseHelp)]
#[clap(subcommand_required = true)]
#[clap(arg_required_else_help = true)]
pub struct Args {
#[clap(long, short = 't')]
/// The amount of threads to use for some operations.
Expand Down
6 changes: 2 additions & 4 deletions src/porcelain/options.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
use std::{ffi::OsString, path::PathBuf};

use clap::AppSettings;

#[derive(Debug, clap::Parser)]
#[clap(about = "The rusty git", version = clap::crate_version!())]
#[clap(setting = AppSettings::SubcommandRequired)]
#[clap(subcommand_required = true)]
pub struct Args {
/// Do not display verbose messages and progress information
#[clap(long, short = 'q')]
Expand Down Expand Up @@ -44,7 +42,7 @@ pub enum Subcommands {

#[cfg(feature = "gitoxide-core-tools")]
#[derive(Debug, clap::Subcommand)]
#[clap(setting = AppSettings::SubcommandRequired)]
#[clap(subcommand_required = true)]
#[clap(visible_alias = "t")]
pub enum ToolCommands {
/// Find all repositories in a given directory.
Expand Down
2 changes: 1 addition & 1 deletion tests/snapshots/porcelain/tools/no-args-failure
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
error: 'ein tools' requires a subcommand, but one was not provided
error: 'ein tools' requires a subcommand but one was not provided

USAGE:
ein tools <SUBCOMMAND>
Expand Down

0 comments on commit aa51e05

Please sign in to comment.