KlusterG.ArgumentModel 1.0.1

dotnet add package KlusterG.ArgumentModel --version 1.0.1
                    
NuGet\Install-Package KlusterG.ArgumentModel -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="KlusterG.ArgumentModel" Version="1.0.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="KlusterG.ArgumentModel" Version="1.0.1" />
                    
Directory.Packages.props
<PackageReference Include="KlusterG.ArgumentModel" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add KlusterG.ArgumentModel --version 1.0.1
                    
#r "nuget: KlusterG.ArgumentModel, 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.
#:package KlusterG.ArgumentModel@1.0.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=KlusterG.ArgumentModel&version=1.0.1
                    
Install as a Cake Addin
#tool nuget:?package=KlusterG.ArgumentModel&version=1.0.1
                    
Install as a Cake Tool

KlusterG.ArgumentModel

  • This project converts command line arguments into a preloaded template.

Requirements

  • .NET Core v7.0 +

How To Import?

NuGet

  • Access the NuGet package manager in your project
  • Click Search
  • Search for KlusterG.ArgumentModel
  • Install the latest version of the library

Command Line

  • Access the Package Manager Console
  • Type the command Install-Package KlusterG.ArgumentModel -Version 1.0.1

.NET CLI

  • Type the command dotnet add package KlusterG.ArgumentModel --version 1.0.1

NuGet ORG

How It Works?

Description

  • Create a data model that represents the arguments and add the attributes to the respective properties

Attribute Arguments

  • isRequired: Boolean type. Used to define as mandatory or not.
  • name: String type. Mandatory use. Used to define argument name.
  • abbreviation: String type. Used to define the argument name abbreviation.

Example:

  • Argument Model in code
using KlusterG.ArgumentModel.Attributes;

namespace KlusterG.ArgumentModel.Sample.Models
{
    public class Person
    {
        [Argument(isRequired: true, name: "--name", abbreviation: "-n")]
        public string Name { get; set; }
        [Argument(isRequired: true, name: "--age", abbreviation: "-a")]
        public int Age { get; set; }
        [Argument(isRequired: false, name: "--alive", abbreviation: "-l")]
        public bool Alive { get; set; }
    }
}
  • Code in Program.Main
using KlusterG.ArgumentModel.Sample.Models;

namespace KlusterG.ArgumentModel.Sample;
public class Program
{
    public static void Main(string[] args)
    {
        var model = ConvertArgument.DefineModel<Person>(args);
    }
}
  • Call the Command Line with arguments
MyProgram.exe --name "Willian Smith" -a 34 --aline
Product Compatible and additional computed target framework versions.
.NET net7.0 is compatible.  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.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net7.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
1.0.1 321 11/29/2023
1.0.0 245 10/19/2023