Senpai 1.0.0

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.0
NuGet\Install-Package Senpai -Version 1.0.0
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.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Senpai --version 1.0.0
#r "nuget: Senpai, 1.0.0"
#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.0

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

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. String
  3. Double

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.

Version Downloads Last updated
3.0.0-preview.1 120 1/27/2023
3.0.0-alpha.2 117 1/20/2023
3.0.0-alpha.1 112 1/19/2023
2.0.0 443 11/5/2022
2.0.0-beta.1.0 169 6/15/2022
2.0.0-alpha.1.0 139 6/9/2022
1.0.2 492 4/5/2022
1.0.1 459 4/5/2022
1.0.0 444 4/5/2022