Skip to content

Commit

Permalink
Merge pull request #447 from adamralph/align-error-messages
Browse files Browse the repository at this point in the history
align error message for invalid verbosity value
  • Loading branch information
adamralph authored Dec 18, 2020
2 parents 16c9a4b + c5666ec commit 64edd80
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion MinVer/Logger.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public static void ErrorInvalidMinMajorMinor(string minMajorMinor) =>
Error(1003, $"Invalid minimum MAJOR.MINOR '{minMajorMinor}'. Valid values are {MajorMinor.ValidValues}");

public static void ErrorInvalidVerbosity(string verbosity) =>
Error(1004, $"Invalid verbosity '{verbosity}'. The value must be {VerbosityMap.ValidValue}.");
Error(1004, $"Invalid verbosity '{verbosity}'. Valid values are {VerbosityMap.ValidValues}.");

#if MINVER
public static void ErrorInvalidVersionOverride(string versionOverride) =>
Expand Down
2 changes: 1 addition & 1 deletion MinVer/VerbosityMap.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ void Add(Verbosity verbosity, int shortLength)
}

// spell-checker:disable
public static string ValidValue => "q[uiet], m[inimal] (default), n[ormal], d[etailed], or diag[nostic] (case insensitive)";
public static string ValidValues => "q[uiet], m[inimal] (default), n[ormal], d[etailed], or diag[nostic] (case insensitive)";

// spell-checker:enable
public static bool TryMap(string value, out Verbosity verbosity) => map.TryGetValue(value, out verbosity);
Expand Down
2 changes: 1 addition & 1 deletion minver-cli/Logger.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public static void ErrorInvalidMinMajorMinor(string minMajorMinor) =>
Error($"Invalid minimum MAJOR.MINOR '{minMajorMinor}'. Valid values are {MajorMinor.ValidValues}");

public static void ErrorInvalidVerbosity(string verbosity) =>
Error($"Invalid verbosity '{verbosity}'. The value must be {VerbosityMap.ValidValue}.");
Error($"Invalid verbosity '{verbosity}'. Valid values are {VerbosityMap.ValidValues}.");

private static void Error(string message) => Message($"error : {message}");

Expand Down
2 changes: 1 addition & 1 deletion minver-cli/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ private static int Main(string[] args)
var minMajorMinorOption = app.Option("-m|--minimum-major-minor <MINIMUM_MAJOR_MINOR>", MajorMinor.ValidValues, CommandOptionType.SingleValue);
var workDirOption = app.Option("-r|--repo <REPO>", "Working directory.", CommandOptionType.SingleValue);
var tagPrefixOption = app.Option("-t|--tag-prefix <TAG_PREFIX>", "", CommandOptionType.SingleValue);
var verbosityOption = app.Option("-v|--verbosity <VERBOSITY>", VerbosityMap.ValidValue, CommandOptionType.SingleValue);
var verbosityOption = app.Option("-v|--verbosity <VERBOSITY>", VerbosityMap.ValidValues, CommandOptionType.SingleValue);
#if MINVER
var versionOverrideOption = app.Option("-o|--version-override <VERSION>", "", CommandOptionType.SingleValue);
#endif
Expand Down
2 changes: 1 addition & 1 deletion minver-cli/VerbosityMap.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ void Add(Verbosity verbosity)
}

// spell-checker:disable
public static string ValidValue => "e[rror], w[arn], i[nfo] (default), d[ebug], or t[race] (case insensitive)";
public static string ValidValues => "e[rror], w[arn], i[nfo] (default), d[ebug], or t[race] (case insensitive)";

// spell-checker:enable
public static bool TryMap(string value, out Verbosity verbosity) => map.TryGetValue(value, out verbosity);
Expand Down

0 comments on commit 64edd80

Please sign in to comment.