Showing posts with label BizArk. Show all posts
Showing posts with label BizArk. Show all posts

Thursday, 17 April 2014

BizArk.Core 2.0.14 was pushed to NuGet

Bizark.Core 2.0.14 was pushed to NuGet

Release notes:
9290   Not parse array of string

Example:

[CmdLineOptions(ArgumentPrefix = "-", AssignmentDelimiter = ':', ArraySeparator = ";")]
public class CmdLineObjectWithStringArray : CmdLineObject
{
    [CmdLineArg]
    public string[] Names { get; set; }
}
You can invoke the console application from command line:

MyConsoleApplication -Names:1;2

Bizark.Core will parse the values into string array of Names: { "1", "2"}



Enjoy!

Wednesday, 11 December 2013

BizArk.Core 2.0.9 was pushed to NuGet

Bizark.Core 2.0.9 was pushed to NuGet

Release notes:
9151 Empty argument prefix does not work and does not

Example:
 
[CmdLineOptions(ArgumentPrefix = "")]
internal class MyCmdLineObject: CmdLineObject
{
     [CmdLineArg]
     public string Name { get; set; }
}
Can be used like this from command-line
MyConsoleApplication.exe Name Boris

In conjunction with ArgumentDelimiter:
 
[CmdLineOptions(ArgumentPrefix = "", ArgumentDelimiter='=')]
internal class MyCmdLineObject : CmdLineObject
{
     [CmdLineArg]
     public string Name { get; set; }
}
From command line
MyConsoleApplication.exe Name=Boris

Also supports string surrounded by double quotes:
 
[CmdLineOptions(ArgumentPrefix = "", ArgumentDelimiter='=')]
internal class MyCmdLineObject : CmdLineObject
{
     [CmdLineArg]
     public string Path { get; set; }
}
MyConsoleApplication.exe Path="C:\Program Files (x86)\Microsoft.NET\"
The value of Path will be @"C:\Program Files (x86)\Microsoft.NET\" without the leading and ending double quotes

Get from nuget:

PM> Install-Package BizArk.Core

Thursday, 24 October 2013

BizArk documentation on Console application

It seems that the best documentation is "single page" with code snippets. Projects with such kind of documentation are easy to understand and to use. I've just added such documentation to BizArk project. 



Tuesday, 17 September 2013

BizArk::Command-line parsing library

Some time ago I needed a simple command line parsing library. After some research I came to BizArk ToolKit by Brian Brewder. Since then I became addicted to this library, contributed a few features of my own, fixed a few bugs. Now I am proud to tell that its recent release version Bizark.Core 2.0.3 is available on nuget. Please don't get confused with the BizArk toolkit of older versions. Here is a sample usage:
 
    public enum ConsoleMode
    {
        Copy,
        Move
    }

    public class SimpleCommandLineArgs : CmdLineObject
    {
        [CmdLineArg]
        public ConsoleMode Mode { get; set; }

        [CmdLineArg]
        public string Path { get; set; }
    }

    public static class Program
    {
        private static void Main(string[] args)
        {
            ConsoleApplication.RunProgram<SimpleCommandLineArgs>(Start);
        }

        private static void Start(SimpleCommandLineArgs args)
        {
            // Your code goes here
        }
    }
It will parse the following command-line arguments and create an instance of SimpleCommandLineArgs:
 
C:> YouConsole.exe /Mode Move /Path C:\ 
Now available on nuget.org

PM> Install-Package BizArk.Core

For more info visit project site on CodePlex: BizArk