Created
April 22, 2020 21:47
-
-
Save BlackFrog1/b113af22d79c016bcd2b27070b7f2653 to your computer and use it in GitHub Desktop.
PowerArgs sample testing slash issue with absolute path
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using PowerArgs; | |
namespace SlashIssueDemo | |
{ | |
public class MyArg | |
{ | |
[ArgShortcut("-f"), ArgPosition(0), ArgExistingFile] | |
public string File { get; set; } | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using PowerArgs; | |
namespace SlashIssueDemo | |
{ | |
internal class Program | |
{ | |
private static void Main(string[] args) | |
{ | |
Console.WriteLine("Slash Demo Program arguments..."); | |
var c = 0; | |
foreach (var a in args) | |
{ | |
Console.WriteLine($" {c++}-->{a}"); | |
} | |
var parse = Args.Parse<MyArg>(args); | |
Console.WriteLine($"\nParsed File name: {parse.File}"); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment