docopt.net 0.8.3

dotnet add package docopt.net --version 0.8.3
                    
NuGet\Install-Package docopt.net -Version 0.8.3
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="docopt.net" Version="0.8.3" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="docopt.net" Version="0.8.3" />
                    
Directory.Packages.props
<PackageReference Include="docopt.net" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add docopt.net --version 0.8.3
                    
#r "nuget: docopt.net, 0.8.3"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package docopt.net@0.8.3
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=docopt.net&version=0.8.3
                    
Install as a Cake Addin
#tool nuget:?package=docopt.net&version=0.8.3
                    
Install as a Cake Tool

docopt.net is a .NET implementation of docopt

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.

Usage

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.

Documentation

The documentation can be found online at https://docopt.github.io/docopt.net/.

Installation

Install the package in a .NET project using:

dotnet add package docopt.net
  • © 2012-2014 Vladimir Keleshev vladimir@keleshev.com
  • © 2013 Dinh Doan Van Bien dinh@doanvanbien.com
  • © 2021 Atif Aziz
  • Portions © .NET Foundation and Contributors
  • Portions © West Wind Technologies, 2008

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 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.  net9.0 was computed.  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. 
.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 is compatible. 
.NET Framework 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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (7)

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

GitHub repositories (5)

Showing the top 5 popular GitHub repositories that depend on docopt.net:

Repository Stars
morelinq/MoreLINQ
Extensions to LINQ to Objects
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 183 12/25/2025
0.8.1 1,127,257 4/3/2022
0.8.0 1,429 3/30/2022
0.7.0 5,651 12/28/2021
0.6.1.11 14,155 3/28/2021
0.6.1.10 193,012 9/23/2018
0.6.1.9 50,712 8/13/2016
0.6.1.8 23,857 6/14/2016
0.6.1.7 2,653 6/14/2016
0.6.1.7-beta3 1,656 6/4/2016
0.6.1.7-beta1 2,186 6/4/2016
0.6.1.6 32,874 9/17/2014
0.6.1.5 4,320 12/30/2013
0.6.1.4 33,627 7/28/2013
0.6.1.3 2,326 7/7/2013
0.6.1.2 2,310 7/7/2013
0.6.1.1 2,413 7/6/2013

See: https://github.com/docopt/docopt.net/releases/tag/v0.8.3

Commit @ c83c86c0ea285c79d5c68611d4530dbe03da6476