Skip to content

Commit

Permalink
Merge pull request #310 from atc-net/feature/spectre-console
Browse files Browse the repository at this point in the history
spectre console version argument fix
  • Loading branch information
davidkallesen authored Apr 2, 2024
2 parents fb401ce + 2cb5cca commit 416612c
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 5 deletions.
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

0 comments on commit 416612c

Please sign in to comment.