GoCommando is a small command line utility helper that does the boring work when creating command line utilities in .NET.

Source code and stuff is on Github.

Tell me more

Going commando is as simple as it is liberating – consider this (imaginary) command line utility:

allowing a potential usage scenario like this:

What was that?

Positional argument: PositionalArgumentAttribute is used to bind the first couple of arguments (if any). As soon as the command line has a named argument, further arguments are assumed to be named.

Positional arguments are bound in the order they appear in the class declaration.

Named argument: NamedArgumentAttribute is used to bind command lines on the form /name:value to a property. Named arguments can have a full name and a shorthand (full name is for n00bs, shorthand is definitely more 1337).

Banner: BannerAttribute is an (optional) attribute that can be used to specify the initial output from the program.

bool: Properties of type bool are assumed to be named value-less flag-type parameters – i.e. either you specify /name on the command line (yielding a value of true), or you don’t (guess what the value is then?)…

…and there’s more!

Description: DescriptionAttribute is used to specify a textual description that will be output when automagically generating a help text for the utility.

Examples: ExampleAttribute can be used to specify one or more examples on acceptable values for that particular parameter.

E.g. like so:

6 thoughts on “GoCommando

  1. Thomas Ardal

    Great! Thank you very much, Mookid.

    By the way, I solved one of the TODO’s in todo.txt. It is now possible to provide a factory methods to the Run-method, which makes it possible to provide your own instance of ICommando. There’s a pull request at GitHub waiting for you.

Comments are closed.