Skip to content

Commit

Permalink
Fix default ValueEnum casing (#1395)
Browse files Browse the repository at this point in the history
Co-authored-by: Jakub Motyka <jakub.motyka@daftmobile.com>
  • Loading branch information
MiniaczQ and Jakub Motyka authored Oct 2, 2023
1 parent 3e0eab7 commit e61559f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -181,16 +181,16 @@ pub struct ConfigArgs {
#[arg(short = 'Z', value_name = "FEATURES", num_args = 0..)]
pub unstable_features: Vec<String>,
/// Output format of coverage report
#[arg(long, short, value_enum, value_name = "FMT", num_args = 0..)]
#[arg(long, short, value_enum, value_name = "FMT", num_args = 0.., ignore_case = true)]
pub out: Vec<OutputFile>,
/// Coverage tracing backend to use
#[arg(long, value_enum, value_name = "ENGINE")]
#[arg(long, value_enum, value_name = "ENGINE", ignore_case = true)]
pub engine: Option<TraceEngine>,
/// Specify a custom directory to write report files
#[arg(long, value_name = "PATH")]
pub output_dir: Option<PathBuf>,
/// cargo subcommand to run. So far only test and build are supported
#[arg(long, value_enum, value_name = "CMD")]
#[arg(long, value_enum, value_name = "CMD", ignore_case = true)]
pub command: Option<Mode>,
/// Calculates relative paths to root directory. If --manifest-path isn't specified it will look for a Cargo.toml in root
#[arg(long, short, value_name = "DIR")]
Expand All @@ -212,7 +212,7 @@ pub struct ConfigArgs {
#[derive(Debug, Clone, Copy, Args)]
pub struct LoggingArgs {
/// Coloring: auto, always, never
#[arg(long, value_enum, value_name = "WHEN")]
#[arg(long, value_enum, value_name = "WHEN", ignore_case = true)]
pub color: Option<Color>,
/// Show debug output - this is used for diagnosing issues with tarpaulin
#[arg(long)]
Expand All @@ -238,7 +238,7 @@ pub struct PrintFlagsArgs {
#[derive(Debug, Clone, Args)]
pub struct RunTypesArgs {
/// Type of the coverage run
#[arg(long, value_enum, value_name = "TYPE")]
#[arg(long, value_enum, value_name = "TYPE", ignore_case = true)]
pub run_types: Vec<RunType>,
/// Test all benches
#[arg(long)]
Expand Down
5 changes: 5 additions & 0 deletions src/config/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ use std::str::FromStr;
ValueEnum,
EnumDisplay,
)]
#[value(rename_all = "PascalCase")]
pub enum Color {
Auto,
Always,
Expand All @@ -27,6 +28,7 @@ pub enum Color {
#[derive(
Debug, Copy, Clone, PartialEq, Eq, Hash, Ord, PartialOrd, Deserialize, Serialize, ValueEnum,
)]
#[value(rename_all = "PascalCase")]
pub enum TraceEngine {
Auto,
Ptrace,
Expand Down Expand Up @@ -60,6 +62,7 @@ impl Default for TraceEngine {
#[derive(
Debug, Copy, Clone, PartialEq, Eq, Hash, Ord, PartialOrd, Deserialize, Serialize, ValueEnum,
)]
#[value(rename_all = "PascalCase")]
pub enum Mode {
Test,
Build,
Expand All @@ -68,6 +71,7 @@ pub enum Mode {
#[derive(
Debug, Copy, Clone, PartialEq, Eq, Hash, Ord, PartialOrd, Deserialize, Serialize, ValueEnum,
)]
#[value(rename_all = "PascalCase")]
pub enum RunType {
Tests,
Doctests,
Expand All @@ -81,6 +85,7 @@ pub enum RunType {
#[derive(
Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash, Deserialize, Serialize, ValueEnum,
)]
#[value(rename_all = "PascalCase")]
#[non_exhaustive]
pub enum OutputFile {
Json,
Expand Down

0 comments on commit e61559f

Please sign in to comment.