Closed bc3tech closed 2 years ago
I ran the program below without providing an option for InputDirectory and got this output: InputDirectory was ''
So I think it works. Re-open if you can provide a repro.
using PowerArgs;
public class Program
{
public static void Main(string[] args)
{
var parsed = Args.Parse<ProgramArgs>(args);
Console.WriteLine($"InputDirectory was '{parsed.InputDirectory}'");
}
}
[TabCompletion]
public class ProgramArgs
{
[HelpHook, ArgShortcut("?"), ArgShortcut("h"), ArgDescription("Shows help")]
public bool Help { get; set; }
[ArgShortcut("in"), ArgDescription(@"The directory containing the files to process"), ArgDefaultValue(@"")]
public string InputDirectory { get; set; }
}
v3.6.0
Consider following args class
Running the containing program without specifying the argument will result in
The app shouldn't except out; it should set
null
as the value on the argument and let the code process accordingly.(Found while debugging #150 )