Senpai 1.0.1

Additional Details

Package has moved to maid

There is a newer version of this package available.
See the version list below for details.
dotnet add package Senpai --version 1.0.1                
NuGet\Install-Package Senpai -Version 1.0.1                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Senpai" Version="1.0.1" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Senpai --version 1.0.1                
#r "nuget: Senpai, 1.0.1"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Senpai as a Cake Addin
#addin nuget:?package=Senpai&version=1.0.1

// Install Senpai as a Cake Tool
#tool nuget:?package=Senpai&version=1.0.1                

Senpai

A simple command handler for cli applications.

Quick Start

using Senpai;

[Command("mycommand", Description = "my command's description.")]
public static void myMethod() 
{
    // my code
}

static void Main(string[] args) 
{
    Cli.Initialize(args);
}

Retrieving parameters

There are 2 ways to interact with parameters/arguments that are passed to the cli.

1. Accessing Cli.Args

var array = Cli.Args;

2. The parameters of a method

[Command("mycommand")]
public static void myMethod(int a, string? b, string c = null)
{
    // 'b' can have a value or be omitted as double-quotes ("")
    // 'c' can have a value or be omitted as nothing
}

Supported Parameter Type

  1. Int
  2. Char
  3. Long
  4. String
  5. Double
  6. Boolean

And nullable of mentioned types.

Note

  1. Methods decorated with the Command attribute must have the public and static modifier.
  2. No support for options/flags, yet. (I'm lazy)
Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net6.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.