Skip to content

Commit

Permalink
Added some cli options
Browse files Browse the repository at this point in the history
  • Loading branch information
ProgrammerAL committed Oct 5, 2024
1 parent 0f1db48 commit c910de3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
4 changes: 2 additions & 2 deletions src/CodeUpdater/CodeUpdater/Options/CommandOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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";
}

0 comments on commit c910de3

Please sign in to comment.