YngveHestem.GenericParameterCollection.Console 1.0.2

dotnet add package YngveHestem.GenericParameterCollection.Console --version 1.0.2                
NuGet\Install-Package YngveHestem.GenericParameterCollection.Console -Version 1.0.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="YngveHestem.GenericParameterCollection.Console" Version="1.0.2" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add YngveHestem.GenericParameterCollection.Console --version 1.0.2                
#r "nuget: YngveHestem.GenericParameterCollection.Console, 1.0.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 YngveHestem.GenericParameterCollection.Console as a Cake Addin
#addin nuget:?package=YngveHestem.GenericParameterCollection.Console&version=1.0.2

// Install YngveHestem.GenericParameterCollection.Console as a Cake Tool
#tool nuget:?package=YngveHestem.GenericParameterCollection.Console&version=1.0.2                

GenericParameterCollection.Console

This provides controls for using GenericParameterCollection in a Console-application.

Supported features

Convert a list of console-arguments to a ParameterCollection

Extension method SetValuesFromConsoleArguments(..)

You provide a ParameterCollection with some default values. Then you can send the array of string-arguments that are provided in the Main-method to the extension-method SetValuesFromConsoleArguments(..). This method will then parse the arguments and try the best to convert the values based on the converters available.

This method supports setting a custom prefix for defining parameter-keys in the console (default is "--"). Mark that all parameter-keys must be only one word.

Get the parameters as a table

Extension method GetParametersHelpTable(..)

You provide a ParameterCollection, and have some ways to customize it. This include an optional Description field and the headers.

FAQ

Are all ParameterType's supported?

All types that can convert from a string is supported. If the type has not support for a string-value as default, or the default string-conversion is not suitable, you can create your own custom converter for that type.

I want to get the contents of a file as a byte-array. Will this library support that?

Currently we do not supply any special converters that opens up a file and get the contents as a byte array. But it should be easy to implement such a converter by creating a custom converter and add it either to the ParameterCollection or directly to the extension method.

What do I need to think about when creating custom converters?

The only thing you neeed to think about when creating custom converters for a program using this library is that all arguments and other inputs given by the user are given as strings.

So if you for example want to create a converter for a Color. You must let the converter support the conversion from string. For example supporting hexadecimal values or strings like "blue", "red", "green", "orange".

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  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. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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.2 136 2/18/2024
1.0.1 103 2/12/2024
1.0.0 175 6/25/2023

- Updated YngveHestem.GenericParameterCollection to version 1.1.0