Revert clap version bump (#111)

* Update README.md

* Update release-cross.yml

* Update release.yml

* style(self_update): Run cargo fmt (#108)

The commit 9105a8aac is not formatted, which breaks the CI check.

Co-authored-by: Thomas Schönauer <37108907+DottoDev@users.noreply.github.com>

* Clap dependencie change

* Revert clap changes

Co-authored-by: pan93412 <pan93412@gmail.com>
This commit is contained in:
Thomas Schönauer
2022-11-02 15:28:47 +00:00
committed by GitHub
parent 9105a8aacf
commit b2b35dcad2
7 changed files with 71 additions and 31 deletions

View File

@@ -6,7 +6,7 @@ use std::process::Command;
use std::{env, fs};
use anyhow::Result;
use clap::{Parser, ValueEnum};
use clap::{ArgEnum, Parser};
use directories::BaseDirs;
use log::debug;
use regex::Regex;
@@ -62,7 +62,7 @@ macro_rules! get_deprecated {
type Commands = BTreeMap<String, String>;
#[derive(ValueEnum, EnumString, EnumVariantNames, Debug, Clone, PartialEq, Eq, Deserialize, EnumIter, Copy)]
#[derive(ArgEnum, EnumString, EnumVariantNames, Debug, Clone, PartialEq, Eq, Deserialize, EnumIter, Copy)]
#[clap(rename_all = "snake_case")]
#[serde(rename_all = "snake_case")]
#[strum(serialize_all = "snake_case")]
@@ -397,78 +397,78 @@ impl ConfigFile {
// Command line arguments
#[derive(Parser, Debug)]
#[command(name = "Topgrade", version)]
#[clap(name = "Topgrade", version)]
pub struct CommandLineArgs {
/// Edit the configuration file
#[arg(long = "edit-config")]
#[clap(long = "edit-config")]
edit_config: bool,
/// Show config reference
#[arg(long = "config-reference")]
#[clap(long = "config-reference")]
show_config_reference: bool,
/// Run inside tmux
#[arg(short = 't', long = "tmux")]
#[clap(short = 't', long = "tmux")]
run_in_tmux: bool,
/// Cleanup temporary or old files
#[arg(short = 'c', long = "cleanup")]
#[clap(short = 'c', long = "cleanup")]
cleanup: bool,
/// Print what would be done
#[arg(short = 'n', long = "dry-run")]
#[clap(short = 'n', long = "dry-run")]
dry_run: bool,
/// Do not ask to retry failed steps
#[arg(long = "no-retry")]
#[clap(long = "no-retry")]
no_retry: bool,
/// Do not perform upgrades for the given steps
#[arg(long = "disable", value_name = "STEP", value_enum, num_args = 1..)]
#[clap(long = "disable", arg_enum, multiple_values = true)]
disable: Vec<Step>,
/// Perform only the specified steps (experimental)
#[arg(long = "only", value_name = "STEP", value_enum, num_args = 1..)]
#[clap(long = "only", arg_enum, multiple_values = true)]
only: Vec<Step>,
/// Run only specific custom commands
#[arg(long = "custom-commands", value_name = "NAME", num_args = 1..)]
#[clap(long = "custom-commands")]
custom_commands: Vec<String>,
/// Set environment variables
#[arg(long = "env", value_name = "NAME=VALUE", num_args = 1..)]
#[clap(long = "env", multiple_values = true)]
env: Vec<String>,
/// Output logs
#[arg(short = 'v', long = "verbose")]
#[clap(short = 'v', long = "verbose")]
pub verbose: bool,
/// Prompt for a key before exiting
#[arg(short = 'k', long = "keep")]
#[clap(short = 'k', long = "keep")]
keep_at_end: bool,
/// Skip sending a notification at the end of a run
#[arg(long = "skip-notify")]
#[clap(long = "skip-notify")]
skip_notify: bool,
/// Say yes to package manager's prompt
#[arg(short = 'y', long = "yes", value_name = "STEP", value_enum, num_args = 0..)]
#[clap(short = 'y', long = "yes", arg_enum, multiple_values = true, min_values = 0)]
yes: Option<Vec<Step>>,
/// Don't pull the predefined git repos
#[arg(long = "disable-predefined-git-repos")]
#[clap(long = "disable-predefined-git-repos")]
disable_predefined_git_repos: bool,
/// Alternative configuration file
#[arg(long = "config", value_name = "PATH")]
#[clap(long = "config")]
config: Option<PathBuf>,
/// A regular expression for restricting remote host execution
#[arg(long = "remote-host-limit", value_name = "REGEX")]
#[clap(long = "remote-host-limit")]
remote_host_limit: Option<Regex>,
/// Show the reason for skipped steps
#[arg(long = "show-skipped")]
#[clap(long = "show-skipped")]
show_skipped: bool,
}