Wheel.Base
2.0.0-beta3
dotnet add package Wheel.Base --version 2.0.0-beta3
NuGet\Install-Package Wheel.Base -Version 2.0.0-beta3
<PackageReference Include="Wheel.Base" Version="2.0.0-beta3" />
paket add Wheel.Base --version 2.0.0-beta3
#r "nuget: Wheel.Base, 2.0.0-beta3"
// Install Wheel.Base as a Cake Addin #addin nuget:?package=Wheel.Base&version=2.0.0-beta3&prerelease // Install Wheel.Base as a Cake Tool #tool nuget:?package=Wheel.Base&version=2.0.0-beta3&prerelease
Usage example
class Program
{
static int Main(string[] args)
=> WheelAppBuilder.CreateDefault<Program>().Run(args);
public static void Define(ICommandBuilder root)
{
root.DefaultCommand<HelloCommand>("hello");
// ... add other definitions here ...
}
}
class HelloCommand
{
public static void Define(ICommandBuilder cmd)
{
cmd.Description = "A polite command";
var nameArg = cmd.Argument("[name]", "Your name");
cmd.Action = () => SayHello(nameArg.Value ?? "world");
}
private static void SayHello(string name)
{
Console.WriteLine("Hello, {0}.", name);
}
}
This program can be launched with various arguments, for instance:
-h
for help on the program (including a list of defined commands)hello -h
for help on command "hello"?
for interfactive modehello -f monde
to call the command "hello" with option "-f" and argument "monde"- no argument to call the default command (which is also the "hello" command)
Define
methods (in classes Program
and HelloCommand
) may also have parameters of types IServiceCollection
(to register services for dependency injection)
and/or IEnv
(to get information about the current environment).
For commands returing values, assign cmd.Func
instead of cmd.Action
.
Property cmd.Services
can be used to access the dependency injection container from the assigned action of function.
Files nlog.config and appsettings.ini can be created in any parent directory to configure logging and application settings.
See more at the project home.
Product | Versions 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 | net20 is compatible. net35 was computed. net40 was computed. net403 was computed. net45 was computed. net451 was computed. net452 was computed. net46 was computed. net461 is compatible. 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. |
-
.NETFramework 2.0
- LinqBridge (>= 1.3.0)
- Newtonsoft.Json (>= 10.0.3)
- NLog (>= 2.1.0)
-
.NETFramework 4.6.1
- MailKit (>= 1.20.0)
- Microsoft.Extensions.Configuration.Binder (>= 2.0.0)
- Microsoft.Extensions.Configuration.Ini (>= 2.0.0)
- Microsoft.Extensions.Configuration.UserSecrets (>= 2.0.0)
- Microsoft.Extensions.DependencyInjection (>= 2.0.0)
- Microsoft.Extensions.Logging (>= 2.0.0)
- Microsoft.Extensions.Logging.Console (>= 2.0.0)
- Microsoft.Extensions.Options.ConfigurationExtensions (>= 2.0.0)
- Newtonsoft.Json (>= 10.0.3)
- NLog (>= 4.5.0-beta07 && < 5.0.0)
- NLog.Extensions.Logging (>= 1.0.0-rtm-rc2)
- PreMailer.Net (>= 2.0.0-beta2)
-
.NETStandard 2.0
- MailKit (>= 1.20.0)
- Microsoft.Extensions.Configuration.Binder (>= 2.0.0)
- Microsoft.Extensions.Configuration.Ini (>= 2.0.0)
- Microsoft.Extensions.Configuration.UserSecrets (>= 2.0.0)
- Microsoft.Extensions.DependencyInjection (>= 2.0.0)
- Microsoft.Extensions.Logging (>= 2.0.0)
- Microsoft.Extensions.Logging.Console (>= 2.0.0)
- Microsoft.Extensions.Options.ConfigurationExtensions (>= 2.0.0)
- Newtonsoft.Json (>= 10.0.3)
- NLog (>= 4.5.0-beta07 && < 5.0.0)
- NLog.Extensions.Logging (>= 1.0.0-rtm-rc2)
- PreMailer.Net (>= 2.0.0-beta2)
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 |
---|