BindOpen.Commands
1.1.13
dotnet add package BindOpen.Commands --version 1.1.13
NuGet\Install-Package BindOpen.Commands -Version 1.1.13
<PackageReference Include="BindOpen.Commands" Version="1.1.13" />
<PackageVersion Include="BindOpen.Commands" Version="1.1.13" />
<PackageReference Include="BindOpen.Commands" />
paket add BindOpen.Commands --version 1.1.13
#r "nuget: BindOpen.Commands, 1.1.13"
#:package BindOpen.Commands@1.1.13
#addin nuget:?package=BindOpen.Commands&version=1.1.13
#tool nuget:?package=BindOpen.Commands&version=1.1.13
BindOpen.Commands
BindOpen is a framework that allows to build widely-extended applications. It enables you to enhance your .NET projects with custom script functions, connectors, entities, and tasks.
About
BindOpen.Commands is a straightforward and comprehensive API for manipulating command-line arguments and handling related tasks.
Install
To get started, install the BindOpen.Commands module you want to use.
Note: We recommend that later on, you install only the package you need.
From Visual Studio
Module | Instruction |
---|---|
BindOpen.Commands | PM> Install-Package BindOpen.Commands |
BindOpen.Commands.Abstrations | PM> Install-Package BindOpen.Commands.Abstrations |
From .NET CLI
Module | Instruction |
---|---|
BindOpen.Commands | > dotnet add package BindOpen.Commands |
BindOpen.Commands.Abstrations | > dotnet add package BindOpen.Commands.Abstrations |
Get started
Define command options
Options are defined using BindOpen metadata, allowing for rich descriptions, default values, types, and validation rules.
var options = BdoCommands.NewOption(
"sample",
BdoCommands.NewOption("version")
.WithAliases("version", "--version", "-v")
.WithLabel(LabelFormats.NameSpaceValue)
.WithDataType(DataValueTypes.Text)
.AsRequired()
.WithDescription("Display the version of the application.")
.Execute(() => ShowVersion())
,
BdoCommands.NewOption("path")
.WithLabel(LabelFormats.OnlyValue)
.WithDataType(DataValueTypes.Text)
.AsRequired()
.WithTitle("_path")
.WithDescription("The path.")
)
.WithDescription("Sample shows you the way to simply specify the options of your application.");
Parse arguments
var scope = BdoScoping.NewScope();
var parameters = scope.ParseArguments(args, options);
Check parameters against option definitions
var log = BdoLogging.NewLog();
var scope = BdoScoping.NewScope();
var parameters = scope.ParseArguments(args, options, log: log);
// Parsing outputs are stored in the log object
Invoke tasks dynamically
var parameters = SystemData.Scope.ParseArguments(args, options);
await parameters.InvokeAsync(q => q.GetData<string>("run") == "A", async () => { await TaskA(); });
Automatically generate help
var scope = BdoScoping.NewScope();
var help = scope.GetHelpText(options);
Trace.WriteLine(help);
License
This project is licensed under the terms of the MIT license. See LICENSE.
Packages
This repository contains the code of the following Nuget packages:
Package | Provision |
---|---|
BindOpen.Commands | Core package |
BindOpen.Commands.Abstrations | Interfaces and enumerations |
The atomicity of these packages allows you install only what you need respecting your solution's architecture.
All of our NuGet packages are available from our NuGet.org profile page.
Other repos and Projects
BindOpen.Hosting enables you to integrate a BindOpen agent within the .NET service builder.
BindOpen.Logging provides a simple and multidimensional logging system, perfect to monitor nested task executions.
A full list of all the repos is available as well.
Documentation and Further Learning
BindOpen Docs
The BindOpen Docs are the ideal place to start if you are new to BindOpen. They are categorized in 3 broader topics:
- Articles to learn how to use BindOpen;
- Notes to follow our releases;
- Api to have an overview of BindOpen APIs.
BindOpen Blog
The BindOpen Blog is where we announce new features, write engineering blog posts, demonstrate proof-of-concepts and features under development.
Feedback
If you're having trouble with BindOpen, file a bug on the BindOpen Issue Tracker.
Donation
You are welcome to support this project. All donations are optional but are greatly appreciated.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net9.0 is compatible. 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. |
-
net9.0
- BindOpen.Commands.Abstractions (>= 1.1.13)
- BindOpen.Data (>= 1.2.176)
- BindOpen.Scoping (>= 1.2.176)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.