![]() |
VOOZH | about |
dotnet add package docopt.net --version 0.8.3
NuGet\Install-Package docopt.net -Version 0.8.3
<PackageReference Include="docopt.net" Version="0.8.3" />
<PackageVersion Include="docopt.net" Version="0.8.3" />Directory.Packages.props
<PackageReference Include="docopt.net" />Project file
paket add docopt.net --version 0.8.3
#r "nuget: docopt.net, 0.8.3"
#:package docopt.net@0.8.3
#addin nuget:?package=docopt.net&version=0.8.3Install as a Cake Addin
#tool nuget:?package=docopt.net&version=0.8.3Install as a Cake Tool
docopt.net is a parser for command-line arguments. It automatically derives the parsing logic from the help text of a program containing its command-line usage in docopt format. docopt is the formalization of conventions that have been used for decades in help messages and man pages for describing a program's interface. Below is an example of such a help text containing the usage for a hypothetical program called Naval Fate:
Naval Fate.
Usage:
naval_fate.exe ship new <name>...
naval_fate.exe ship <name> move <x> <y> [--speed=<kn>]
naval_fate.exe ship shoot <x> <y>
naval_fate.exe mine (set|remove) <x> <y> [--moored | --drifting]
naval_fate.exe (-h | --help)
naval_fate.exe --version
Options:
-h --help Show this screen.
--version Show version.
--speed=<kn> Speed in knots [default: 10].
--moored Moored (anchored) mine.
--drifting Drifting mine.
The following C# example shows one basic way to use docopt.net:
#nullable enable
using System;
using DocoptNet;
const string usage = @"Naval Fate.
Usage:
naval_fate.exe ship new <name>...
naval_fate.exe ship <name> move <x> <y> [--speed=<kn>]
naval_fate.exe ship shoot <x> <y>
naval_fate.exe mine (set|remove) <x> <y> [--moored | --drifting]
naval_fate.exe (-h | --help)
naval_fate.exe --version
Options:
-h --help Show this screen.
--version Show version.
--speed=<kn> Speed in knots [default: 10].
--moored Moored (anchored) mine.
--drifting Drifting mine.
";
var arguments = new Docopt().Apply(usage, args, version: "Naval Fate 2.0", exit: true)!;
foreach (var (key, value) in arguments)
Console.WriteLine("{0} = {1}", key, value);
See the documentation for more examples and uses of the docopt.net API.
The documentation can be found online at https://docopt.github.io/docopt.net/.
Install the package in a .NET project using:
dotnet add package docopt.net
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 net5.0 was computed. net5.0-windows net5.0-windows was computed. net6.0 net6.0 was computed. net6.0-android net6.0-android was computed. net6.0-ios net6.0-ios was computed. net6.0-maccatalyst net6.0-maccatalyst was computed. net6.0-macos net6.0-macos was computed. net6.0-tvos net6.0-tvos was computed. net6.0-windows net6.0-windows was computed. net7.0 net7.0 was computed. net7.0-android net7.0-android was computed. net7.0-ios net7.0-ios was computed. net7.0-maccatalyst net7.0-maccatalyst was computed. net7.0-macos net7.0-macos was computed. net7.0-tvos net7.0-tvos was computed. net7.0-windows net7.0-windows was computed. net8.0 net8.0 was computed. net8.0-android net8.0-android was computed. net8.0-browser net8.0-browser was computed. net8.0-ios net8.0-ios was computed. net8.0-maccatalyst net8.0-maccatalyst was computed. net8.0-macos net8.0-macos was computed. net8.0-tvos net8.0-tvos was computed. net8.0-windows net8.0-windows was computed. net9.0 net9.0 was computed. net9.0-android net9.0-android was computed. net9.0-browser net9.0-browser was computed. net9.0-ios net9.0-ios was computed. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. net10.0 net10.0 was computed. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
| .NET Core | netcoreapp2.0 netcoreapp2.0 was computed. netcoreapp2.1 netcoreapp2.1 was computed. netcoreapp2.2 netcoreapp2.2 was computed. netcoreapp3.0 netcoreapp3.0 was computed. netcoreapp3.1 netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 netstandard2.0 is compatible. netstandard2.1 netstandard2.1 is compatible. |
| .NET Framework | net461 net461 was computed. net462 net462 was computed. net463 net463 was computed. net47 net47 is compatible. net471 net471 was computed. net472 net472 was computed. net48 net48 was computed. net481 net481 was computed. |
| MonoAndroid | monoandroid monoandroid was computed. |
| MonoMac | monomac monomac was computed. |
| MonoTouch | monotouch monotouch was computed. |
| Tizen | tizen40 tizen40 was computed. tizen60 tizen60 was computed. |
| Xamarin.iOS | xamarinios xamarinios was computed. |
| Xamarin.Mac | xamarinmac xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos xamarinwatchos was computed. |
Showing the top 5 NuGet packages that depend on docopt.net:
| Package | Downloads |
|---|---|
|
Xamarin.UITest
UI Automation Framework for testing Android and iOS apps. |
|
|
FluentMigrator.Runner.Cli
A runner for .NET CLI for Fluent Migrator. |
|
|
FluentMigrator.Runner.Cli.Executor
A runner for .NET CLI for Fluent Migrator. |
|
|
FluentMigrator.Runner.DNX
A runner for DNX for Fluent Migrator. |
|
|
G1.ConsoleApp
Package Description |
Showing the top 6 popular GitHub repositories that depend on docopt.net:
| Repository | Stars |
|---|---|
|
morelinq/MoreLINQ
Extensions to LINQ to Objects
|
|
|
tonybaloney/CSnakes
Embed Python in .NET
|
|
|
nsacyber/Windows-Event-Log-Messages
Retrieves the definitions of Windows Event Log messages embedded in Windows binaries and provides them in discoverable formats. #nsacyber
|
|
|
atifaziz/LinqPadless
LINQPad Queries without LINQPad
|
|
|
microsoft/Vipr
Client Library Generation Toolkit
|
|
|
microsoft/near-duplicate-code-detector
A simple tool for detecting near-duplicate source code
|
| Version | Downloads | Last Updated |
|---|---|---|
| 0.8.3 | 11,148 | 12/25/2025 |
| 0.8.1 | 1,237,181 | 4/3/2022 |
| 0.8.0 | 1,507 | 3/30/2022 |
| 0.7.0 | 7,041 | 12/28/2021 |
| 0.6.1.11 | 14,403 | 3/28/2021 |
| 0.6.1.10 | 199,230 | 9/23/2018 |
| 0.6.1.9 | 53,101 | 8/13/2016 |
| 0.6.1.8 | 24,691 | 6/14/2016 |
| 0.6.1.7 | 2,710 | 6/14/2016 |
| 0.6.1.7-beta3 | 1,726 | 6/4/2016 |
| 0.6.1.7-beta1 | 2,270 | 6/4/2016 |
| 0.6.1.6 | 34,783 | 9/17/2014 |
| 0.6.1.5 | 4,397 | 12/30/2013 |
| 0.6.1.4 | 35,160 | 7/28/2013 |
| 0.6.1.3 | 2,384 | 7/7/2013 |
| 0.6.1.2 | 2,378 | 7/7/2013 |
| 0.6.1.1 | 2,498 | 7/6/2013 |
See: https://github.com/docopt/docopt.net/releases/tag/v0.8.3
Commit @ c83c86c0ea285c79d5c68611d4530dbe03da6476