Mipa 1.0.1
dotnet add package Mipa --version 1.0.1
NuGet\Install-Package Mipa -Version 1.0.1
<PackageReference Include="Mipa" Version="1.0.1" />
paket add Mipa --version 1.0.1
#r "nuget: Mipa, 1.0.1"
// Install Mipa as a Cake Addin #addin nuget:?package=Mipa&version=1.0.1 // Install Mipa as a Cake Tool #tool nuget:?package=Mipa&version=1.0.1
Mipa
Mini Parser for text that contains attributed values. Originally designed to work similarily to Discord slash command arguments, but without having to set them as actual variables. Though its use-cases may vary to cases like terminal apps.
How to use it
var parser = new MipaParser();
var result = parser.Parse("hello! foo:bar");
result.Content // "hello!"
result.Arguments // [{"foo": "bar"}]
Parsing Input
Any parsed text in Mipa comes with a basic set of parsing for arguments. Any type with the IParsable interface implemented works with Mipa.
var result = parser.Parse("welcome to the chat! date:08/18/2018");
result.GetArgument<DateTime>("date") // 8/18/2018 12:00:00 AM
Defining your own argument parsers
The recommended way to implemented argument parsers is to implement IParsable into your data structure. Mipa will pass the raw text into TryParse, and will return a value if the parser succeeds in parsing it.
Product | Versions 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. |
-
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.