From c910de3be7e591ee56f8fc911f50b7d21348f008 Mon Sep 17 00:00:00 2001 From: Al Rodriguez Date: Sat, 5 Oct 2024 00:12:55 -0400 Subject: [PATCH] Added some cli options --- README.md | 8 +++++++- src/CodeUpdater/CodeUpdater/Options/CommandOptions.cs | 4 ++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index a5cbb28..5f0f0eb 100644 --- a/README.md +++ b/README.md @@ -32,10 +32,16 @@ There are 2 ways to run this. As a .NET Tool installed on your machine, or downl - --config-file, -d - Required - Path to the file to use for config values when updating code +- --output-file, -o + - Optional + - If this is set, it will be the file to write logs to, in addition to the console +- --log-level, -l + - Optional + - Verbosity level to log. Valid values are: Verbose, Info, Warn, Error. Default value: verbose. ## Config File -The config file holds all values to determine what changes to make to code files. The reason this is separate from CLI input arguments is to let a developer store this config in different repos but have this .NET Tool installed globally on their machine. That makes it easy to let other developers run this tool with specific settings for each repository, while only needing to provide a single CLI input argument. +The config file holds all values to determine what changes to make. The reason this is separate from CLI input arguments is to let a developer store this config in different repos but have this .NET Tool installed globally on their machine. That makes it easy to let other developers run this tool with specific settings for each repository, while only needing to provide a single CLI input argument. Below are the list of properties in the config file. All fields are required. diff --git a/src/CodeUpdater/CodeUpdater/Options/CommandOptions.cs b/src/CodeUpdater/CodeUpdater/Options/CommandOptions.cs index d13f7f8..eb88d44 100644 --- a/src/CodeUpdater/CodeUpdater/Options/CommandOptions.cs +++ b/src/CodeUpdater/CodeUpdater/Options/CommandOptions.cs @@ -14,9 +14,9 @@ public class CommandOptions [Option(shortName: 'c', longName: "config-file", Required = true, HelpText = "Path to the file to use for config values when updating code")] public required string ConfigFile { get; set; } - [Option(shortName: 'o', longName: "output-file", Required = false, HelpText = "If this is set, it will be the file to write logs to.")] + [Option(shortName: 'o', longName: "output-file", Required = false, HelpText = "If this is set, it will be the file to write logs to, in addition to the console")] public string? OutputFile { get; set; } - [Option(shortName: 'l', longName: "log-level", Required = false, HelpText = "Level to log. Valid values are: Verbose, Info, Warn, Error. Default value is verbose.")] + [Option(shortName: 'l', longName: "log-level", Required = false, HelpText = "Verbosity level to log. Valid values are: Verbose, Info, Warn, Error. Default value: verbose.")] public string LogLevel { get; set; } = "verbose"; }