Enabling your C# methods to be CLI callable
I made a library that makes it easy to enable your static functions to be called through CLI https://github.com/AlexanderBrevig/LazyCLI
Easily install with NuGet using Package Manager Console:
PM> Install-Package LazyCLI
Give this class:
namespace CLI
{
public static class Hello
{
[LazyCLI]
public static void World(string msg)
{
Console.WriteLine("Hello World: " + msg);
}
}
}
You can call the World method using:
LazyCLI.CLI.HandleArgs(new string[] { "CLI", "Hello", "World", "This is pretty handy" });
Will print:
Hello World: This is pretty handy
Written by Alexander Brevig
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Cli
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#