Skip to content

Instantly share code, notes, and snippets.

@BlackFrog1
Created April 22, 2020 21:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save BlackFrog1/b113af22d79c016bcd2b27070b7f2653 to your computer and use it in GitHub Desktop.
Save BlackFrog1/b113af22d79c016bcd2b27070b7f2653 to your computer and use it in GitHub Desktop.
PowerArgs sample testing slash issue with absolute path
using PowerArgs;
namespace SlashIssueDemo
{
public class MyArg
{
[ArgShortcut("-f"), ArgPosition(0), ArgExistingFile]
public string File { get; set; }
}
}
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