Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

spectre console version argument fix #310

Merged
merged 3 commits into from
Apr 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion atc-coding-rules-updater.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ atc-coding-rules-updater `
run `
-p $currentPath `
--optionsPath $currentPath'\atc-coding-rules-updater.json' `
-v
--verbose
2 changes: 1 addition & 1 deletion src/Atc.Console.Spectre/CommandConstants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ public static class CommandConstants
{
public const string ArgumentShortHelp = "-h";
public const string ArgumentLongHelp = "--help";
public const string ArgumentShortVersion = "-v";
public const string ArgumentLongVersion = "--version";
public const string ArgumentShortVerbose = "-v";
public const string ArgumentLongVerbose = "--verbose";

public const string NameOptionsFile = "options-file";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ namespace Atc.Console.Spectre.CommandSettings;

public class BaseCommandSettings : global::Spectre.Console.Cli.CommandSettings
{
[CommandOption($"{CommandConstants.ArgumentShortVerbose}|{CommandConstants.ArgumentLongVerbose}")]
[CommandOption($"{CommandConstants.ArgumentLongVerbose}")]
[Description("Use verbose for more debug/trace information")]
public bool Verbose { get; set; }

Expand Down
3 changes: 1 addition & 2 deletions src/Atc.Console.Spectre/Helpers/ProgramCsHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ public static void SetMinimumLogLevelIfNeeded(
throw new ArgumentNullException(nameof(consoleLoggerConfiguration));
}

if (args.Any(x => x.Equals(CommandConstants.ArgumentShortVerbose, StringComparison.OrdinalIgnoreCase)) ||
args.Any(x => x.Equals(CommandConstants.ArgumentLongVerbose, StringComparison.OrdinalIgnoreCase)))
if (args.Any(x => x.Equals(CommandConstants.ArgumentLongVerbose, StringComparison.OrdinalIgnoreCase)))
{
consoleLoggerConfiguration.MinimumLogLevel = LogLevel.Trace;
}
Expand Down
Loading