All Projects → rebus-org → GoCommando

rebus-org / GoCommando

Licence: other
Console application helper library

Programming Languages

C#
18002 projects
Batchfile
5799 projects

Projects that are alternatives of or similar to GoCommando

Hledger
A reliable, user-friendly Plain Text Accounting tool with command line, terminal and web interfaces.
Stars: ✭ 1,887 (+3394.44%)
Mutual labels:  console-application
Sc Im
sc-im - Spreadsheet Calculator Improvised -- An ncurses spreadsheet program for terminal
Stars: ✭ 3,081 (+5605.56%)
Mutual labels:  console-application
kuzusi
breakout for terminal
Stars: ✭ 19 (-64.81%)
Mutual labels:  console-application
Hexed
Windows console-based hex editor
Stars: ✭ 145 (+168.52%)
Mutual labels:  console-application
Rxterm
Functional reactive terminals in C++ ⚡⌨️
Stars: ✭ 226 (+318.52%)
Mutual labels:  console-application
Moe
A command line based editor inspired by vi/vim. Written in Nim.
Stars: ✭ 252 (+366.67%)
Mutual labels:  console-application
Nano Win
GNU nano text editor for Windows [WARNING: The master branch is constantly rebased and force-pushed so don't expect it to be steady!! -end WARNING]
Stars: ✭ 123 (+127.78%)
Mutual labels:  console-application
ping-multi
Interactively ping multiple hosts from one location
Stars: ✭ 15 (-72.22%)
Mutual labels:  console-application
Laravel Zero
A PHP framework for console artisans
Stars: ✭ 2,821 (+5124.07%)
Mutual labels:  console-application
pysces
The official PySCeS project source code repository.
Stars: ✭ 25 (-53.7%)
Mutual labels:  console-application
Kilua
A minimal text-editor with lua scripting.
Stars: ✭ 158 (+192.59%)
Mutual labels:  console-application
Pms
Practical Music Search is an interactive Vim-like console client for the Music Player Daemon.
Stars: ✭ 182 (+237.04%)
Mutual labels:  console-application
xamarin-forms-gui.cs
Xamarin.Forms gui.cs Backend
Stars: ✭ 74 (+37.04%)
Mutual labels:  console-application
Criterion
Microbenchmarking for Modern C++
Stars: ✭ 140 (+159.26%)
Mutual labels:  console-application
fbida
ida (motif) and fbi (linux console) image viewers, also fbpdf & misc tools.
Stars: ✭ 41 (-24.07%)
Mutual labels:  console-application
Pong Command
pong is not ping. pong is CLI game.
Stars: ✭ 121 (+124.07%)
Mutual labels:  console-application
Commanddotnet
A modern framework for building modern CLI apps
Stars: ✭ 251 (+364.81%)
Mutual labels:  console-application
PassLock
PassLock is a medium-security password manager that encrypts passwords using Advanced Encryption Standards (AES)
Stars: ✭ 44 (-18.52%)
Mutual labels:  console-application
ilua
Portable Lua kernel for Jupyter
Stars: ✭ 99 (+83.33%)
Mutual labels:  console-application
stochpy
StochPy is a versatile stochastic modeling package which is designed for stochastic simulation of molecular control networks
Stars: ✭ 36 (-33.33%)
Mutual labels:  console-application

What?

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

More info coming soon at http://mookid.dk/gocommando

One day, maybe I'll tweet something as well... @mookid8000

How?

Create a new console application. Install-Package GoCommando to get the DLL, and then Go.Run() in the Main method.

And then you add some classes that implement ICommand and you decorate them with [Command] and then you add properties to those classes, and then you decorate those with [Parameter].

And then you decorate the command class and the parameter properties with [Description].

And then you add a couple of [Example] to some of the parameter properties, just to be nice.

Example!

This is the white-russian command in a fictive Beverage utility:

[Command("white-russian")]
[Description("Mixes a White Russian, pouring in milk till full")]
public class WhiteRussian : ICommand
{
    [Parameter("vodka")]
    [Description("How many cl of vodka?")]
    public double Vodka { get; set; }

    [Parameter("kahlua")]
    [Description("How many cl of Kahlua?")]
    public double Kahlua { get; set; }

    [Parameter("lukewarm", optional: true)]
    [Description("Avoid refrigerated ingredients?")]
    public bool LukeWarm { get; set; }

    public void Run()
    {
        Console.WriteLine($"Making a {(LukeWarm ? "luke-warm" : "")} beverage" +
                            $" with {Vodka:0.#} cl of vodka" +
                            $" and {Kahlua:0.#} cl of Kahlua");
    }
}

If you invoke it without its command, it will print out the available commands:

C:\> beverage.exe

------------------------------
Beverage Utility

Copyright (c) 2015 El Duderino
------------------------------
Please invoke with a command - the following commands are available:

    white-russian - Mixes a White Russian, pouring in milk till full

Invoke with -help <command> to get help for each command.

Exit code: -1

and then, if you add -help white-russian as an argument, you'll get detailed help for that command:

C:\> beverage.exe -help white-russian

------------------------------
Beverage Utility

Copyright (c) 2015 El Duderino
------------------------------
Mixes a White Russian, pouring in milk till full

Type

    Beverage.exe white-russian <args>

where <args> can consist of the following parameters:

    -vodka
        How many cl of vodka?

    -kahlua
        How many cl of Kahlua?

    -lukewarm (flag/optional)
        Avoid refrigerated ingredients?

If you try to invoke a command, and one or more of the arguments are missing, you'll know:

C:\> beverage white-russian -vodka 1

------------------------------
Beverage Utility

Copyright (c) 2015 El Duderino
------------------------------
The following required parameters are missing:

    -kahlua - How many cl of Kahlua?

Invoke with -help <command> to get help for each command.

Exit code: -1

and then, when you finally invoke the command with the right arguments, it'll run as you would probably expect:

C:\> beverage white-russian -vodka 2 -kahlua 2

------------------------------
Beverage Utility

Copyright (c) 2015 El Duderino
------------------------------
Making a  beverage with 2 cl of vodka and 2 cl of Kahlua

Neat.

License

GoCommando is Beer-ware.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].