Niche.CommandLineProcessor
3.1.0
See the version list below for details.
dotnet add package Niche.CommandLineProcessor --version 3.1.0
NuGet\Install-Package Niche.CommandLineProcessor -Version 3.1.0
<PackageReference Include="Niche.CommandLineProcessor" Version="3.1.0" />
paket add Niche.CommandLineProcessor --version 3.1.0
#r "nuget: Niche.CommandLineProcessor, 3.1.0"
// Install Niche.CommandLineProcessor as a Cake Addin
#addin nuget:?package=Niche.CommandLineProcessor&version=3.1.0
// Install Niche.CommandLineProcessor as a Cake Tool
#tool nuget:?package=Niche.CommandLineProcessor&version=3.1.0
Niche.CommandLine
A simple convention based argument handler to make it easy for .NET developers to write console applications.
Conventions
Commandline options are declared by writing methods that comply with the appropriate convention (see below for examples).
Each option has a short form starting with a single dash -
(e.g.: -f
, -h
or -rs
) and a long form starting with a
double dash --
(e.g.: --find
, --help
or --report-status
). These names are derived from the names of the
implementing methods (e.g.: Find()
, Help()
or ReportStatus()
).
Switches
To define a switch, declare a method with no return and no parameters. Give it a [Description]
attribute to document
what the switch does.
For example, this method:
[Description("Show help listing all available options")]
public void Help();
will give the options -h
and --help
.
Parameters
To define a parameter, declare a method with no return and one parameter. Again, give it a [Description]
attribute to
document what the option does.
For example, this method:
[Description("Find files that match a wildcard")]
public void Find(string wildcard);
will give the options -f <wildcard>
and --find <wildcard>
.
Modes
To define a whole new mode, declare a method returning a new driver instance that has no parameters. Again, you "opt-in"
by giving it a [Description]
attribute to document what the mode does.
For example, this method:
[Description("Compare the results of two compilers between systems")]
public CompilerDriver TestCompiler();
declares a mode test-compiler
.
See Mode Support for more information.
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 | netcoreapp1.0 was computed. netcoreapp1.1 was computed. netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard1.6 is compatible. netstandard2.0 was computed. netstandard2.1 was computed. |
.NET Framework | net45 is compatible. net451 was computed. net452 was computed. net46 is compatible. net461 was computed. net462 was computed. net463 was computed. net47 is compatible. 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 | tizen30 was computed. 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 4.5
- System.ComponentModel.TypeConverter (>= 4.3.0)
- System.ValueTuple (>= 4.4.0)
-
.NETFramework 4.6
- System.ComponentModel.TypeConverter (>= 4.3.0)
- System.ValueTuple (>= 4.4.0)
-
.NETFramework 4.7
- System.ComponentModel.TypeConverter (>= 4.3.0)
- System.ValueTuple (>= 4.4.0)
-
.NETStandard 1.6
- NETStandard.Library (>= 1.6.1)
- System.ComponentModel.TypeConverter (>= 4.3.0)
- System.ValueTuple (>= 4.4.0)
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 |
---|---|---|
3.1.4 | 1,427 | 1/20/2018 |
3.1.3 | 1,068 | 1/11/2018 |
3.1.2 | 1,099 | 12/10/2017 |
3.1.1 | 1,096 | 12/9/2017 |
3.1.0 | 1,168 | 12/9/2017 |
3.0.4 | 1,117 | 11/23/2017 |
2.0.52 | 1,121 | 7/9/2017 |
2.0.46 | 1,380 | 10/11/2016 |
2.0.45 | 1,545 | 9/20/2016 |
2.0.44 | 1,622 | 9/20/2016 |
2.0.34 | 1,620 | 4/21/2015 |
2.0.33 | 1,406 | 1/27/2015 |
2.0.31 | 1,428 | 1/22/2015 |
2.0.30 | 1,344 | 1/3/2015 |
2.0.29 | 1,669 | 12/16/2014 |
2.0.28 | 1,607 | 12/16/2014 |
2.0.27 | 1,616 | 12/16/2014 |
2.0.26 | 1,639 | 11/23/2014 |
2.0.25 | 1,626 | 11/23/2014 |
2.0.24 | 1,657 | 11/23/2014 |
2.0.23 | 1,713 | 11/23/2014 |
1.0.22 | 1,503 | 8/24/2014 |
1.0.21 | 1,451 | 8/22/2014 |
1.0.20 | 1,472 | 8/10/2014 |
1.0.19 | 1,439 | 8/9/2014 |
1.0.17 | 1,440 | 8/7/2014 |
1.0.16 | 1,411 | 8/5/2014 |
* Update version number for minor change
* Defer display of help and errors using Dispose()
* Fix version number in packaged DLLs