From 362ff70a24e7b5fbce6b066283821ecde3799141 Mon Sep 17 00:00:00 2001 From: pvds <36538317+pawelvds@users.noreply.github.com> Date: Sun, 22 Oct 2023 23:11:07 +0200 Subject: [PATCH 1/2] Added -v and --verbosity aliases for the --log-level option --- .../Configuration/Configuration.cs | 1 + src/fiskaltrust.Launcher/Commands/Common.cs | 6 +++++- src/fiskaltrust.Launcher/Commands/ConfigCommand.cs | 2 ++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/fiskaltrust.Launcher.Common/Configuration/Configuration.cs b/src/fiskaltrust.Launcher.Common/Configuration/Configuration.cs index 84d9127a..32b2fba5 100644 --- a/src/fiskaltrust.Launcher.Common/Configuration/Configuration.cs +++ b/src/fiskaltrust.Launcher.Common/Configuration/Configuration.cs @@ -103,6 +103,7 @@ private T WithDefault(T value, Func defaultValue) private LogLevel? _logLevel; [JsonPropertyName("logLevel")] + [AlternateName("verbosity")] public LogLevel? LogLevel { get => WithDefault(_logLevel, Microsoft.Extensions.Logging.LogLevel.Information); set => _logLevel = value; } private Uri? _packagesUrl; diff --git a/src/fiskaltrust.Launcher/Commands/Common.cs b/src/fiskaltrust.Launcher/Commands/Common.cs index 892584c3..542158d4 100644 --- a/src/fiskaltrust.Launcher/Commands/Common.cs +++ b/src/fiskaltrust.Launcher/Commands/Common.cs @@ -25,7 +25,11 @@ public CommonCommand(string name, bool addCliOnlyParameters = true) : base(name) AddOption(new Option("--access-token")); AddOption(new Option("--sandbox")); AddOption(new Option("--log-folder")); - AddOption(new Option("--log-level")); + + var logLevelOption = new Option("--log-level", "Set the log level of the application."); + logLevelOption.AddAlias("-v"); + logLevelOption.AddAlias("--verbosity"); + AddOption(logLevelOption); if (addCliOnlyParameters) { diff --git a/src/fiskaltrust.Launcher/Commands/ConfigCommand.cs b/src/fiskaltrust.Launcher/Commands/ConfigCommand.cs index 27f7d41d..5fee9530 100644 --- a/src/fiskaltrust.Launcher/Commands/ConfigCommand.cs +++ b/src/fiskaltrust.Launcher/Commands/ConfigCommand.cs @@ -19,6 +19,8 @@ public ConfigCommand() : base("config") AddOption(new Option("--launcher-configuration-file", getDefaultValue: () => "launcher.configuration.json")); AddCommand(new ConfigSetCommand()); AddCommand(new ConfigGetCommand()); + AddOption(new Option(new[] { "--log-level", "-v", "--verbosity" }, "Sets the verbosity level of the logging.")); + } } From 05b9fa2a17e05b23fe295eefa3a5d00676fceadd Mon Sep 17 00:00:00 2001 From: PawelKarczewski Date: Mon, 23 Oct 2023 10:53:30 +0200 Subject: [PATCH 2/2] Cosmetic change --- src/fiskaltrust.Launcher/Commands/Common.cs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/fiskaltrust.Launcher/Commands/Common.cs b/src/fiskaltrust.Launcher/Commands/Common.cs index 542158d4..ec2483cc 100644 --- a/src/fiskaltrust.Launcher/Commands/Common.cs +++ b/src/fiskaltrust.Launcher/Commands/Common.cs @@ -25,11 +25,7 @@ public CommonCommand(string name, bool addCliOnlyParameters = true) : base(name) AddOption(new Option("--access-token")); AddOption(new Option("--sandbox")); AddOption(new Option("--log-folder")); - - var logLevelOption = new Option("--log-level", "Set the log level of the application."); - logLevelOption.AddAlias("-v"); - logLevelOption.AddAlias("--verbosity"); - AddOption(logLevelOption); + AddOption(new Option(new[] { "--log-level", "-v", "--verbosity" }, "Sets the verbosity level of the logging.")); if (addCliOnlyParameters) {