Quikline 0.1.2

There is a newer version of this package available.
See the version list below for details.
dotnet add package Quikline --version 0.1.2                
NuGet\Install-Package Quikline -Version 0.1.2                
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="Quikline" Version="0.1.2" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Quikline --version 0.1.2                
#r "nuget: Quikline, 0.1.2"                
#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 Quikline as a Cake Addin
#addin nuget:?package=Quikline&version=0.1.2

// Install Quikline as a Cake Tool
#tool nuget:?package=Quikline&version=0.1.2                

Quikline

Quikline provides an easy, intuitive API for creating your Command Line Interface.

Quikline is attribute based, create a struct and tag it with the [Command] attribute. Tag your options with [Option] and your positional arguments with [Argument].

Each of these have several properties for you to fill in to customize your API, the most important of which is the Description.

Features

  • Command

    • Automatically generates a help text
    • Can have a --version flag which is generated from the assembly version
    • Can have a description which is used in the help text
  • Subcommand

    • Automatically generates a help text
    • Can have a description which is used in the help text
  • Option

    • Can have a short and a long name
    • Can be required
    • Can have a default value
    • Choose prefix for short and long names (default is - and -- respectively)
    • Discriminates between lower and upper case short names (e.g. -v and -V are different)
    • Provide a description which is used in the help text
  • Argument

    • Can be nullable (optional) or non-nullable (required)
    • Can have a default value (only for non-nullable and makes it optional)
    • Can have a description which is used in the help text

Example

[Command(Version=true, Description="My command line tool")]
public readonly struct MyCommand {    
    [Option(Short = 'v', Long = "verbose", Description = "Enable verbose output")]
    public readonly bool Verbose;
    
    [Option(Short = 'q', Long = "quiet", Description = "Enable quiet output")]
    public readonly bool Quiet;
    
    [Argument(Description = "Some argument")]
    public readonly string? Argument; // Nullable means optional
    
    [Argument(Description = "Some other argument")]
    public readonly string OtherArgument; // Not nullable so its required
    
    [Argument(Description = "Some third argument", Default="default")]
    public readonly string ThirdArgument; // Not nullable, but has default so its optional
    
    [Argument(Description = "Some invalid argument", Default="default")]
    public readonly string? InvalidArgument; // Nullable and has default which is not allowed
}

Now that you've defined your commands structure, all you have to do is let Quikline do the magic:

var myCommand = Quik.Parse<MyCommand>();
Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  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.
  • net8.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
0.3.0 104 5/22/2024
0.2.1 132 4/30/2024
0.2.0 124 4/30/2024
0.1.3 108 4/23/2024
0.1.2 106 4/23/2024
0.1.1 121 4/23/2024
0.1.0.1 114 4/23/2024
0.1.0 113 4/23/2024

The first release of Quikline v0.1.0.0. You can define a command, group args in sub-structs and define subcommands.