Rename CLI args

This commit is contained in:
Marcello 2022-05-24 20:26:13 +02:00
parent dfd999dff4
commit 150685acee
Signed by: m-lamonaca
SSH key fingerprint: SHA256:8db8uii6Gweq7TbKixFBioW2T8CbgtyFETyYL3cr3zk

View file

@ -9,11 +9,11 @@ app.AddCommand(RootCommand);
app.Run(); app.Run();
static async Task RootCommand( static async Task RootCommand(
[Option("extensions", new[] { 'e' }, Description = "Comma separated list of script extensions to search")] string? extensions, [Option("extensions", new[] { 'x' }, Description = "Comma separated list of script extensions")] string? extensions,
[Option("depth", new[] { 'd' }, Description = "Folder depth of the search")] int depth = 1, [Option("depth", new[] { 'd' }, Description = "Search depth")] int depth = 1,
[Option("elevated", new[] { 'E' }, Description = "Run the script with elevated privileges")] bool elevated = false, [Option("elevated", new[] { 'e' }, Description = "Run with elevated privileges")] bool elevated = false,
[Option("grouped", new[] { 'g' }, Description = "Group selection bay containing folder")] bool grouped = false, [Option("group", new[] { 'g' }, Description = "Group scripts by folder")] bool group = false,
[Argument(Name = "Directory", Description = "Directory from which search the scripts")] string directory = ".") [Argument(Name = "Directory", Description = "Starting directory")] string directory = ".")
{ {
if (!Directory.Exists(directory)) if (!Directory.Exists(directory))
{ {
@ -25,7 +25,7 @@ static async Task RootCommand(
FileInfo[] files; FileInfo[] files;
var finder = new ScriptFinder(extensions, directory, depth); var finder = new ScriptFinder(extensions, directory, depth);
if (grouped) if (group)
{ {
var dict = finder.GetScriptsByDirectory(); var dict = finder.GetScriptsByDirectory();