Wolfe.CommandLine
0.1.0
See the version list below for details.
dotnet add package Wolfe.CommandLine --version 0.1.0
NuGet\Install-Package Wolfe.CommandLine -Version 0.1.0
<PackageReference Include="Wolfe.CommandLine" Version="0.1.0" />
<PackageVersion Include="Wolfe.CommandLine" Version="0.1.0" />
<PackageReference Include="Wolfe.CommandLine" />
paket add Wolfe.CommandLine --version 0.1.0
#r "nuget: Wolfe.CommandLine, 0.1.0"
#:package Wolfe.CommandLine@0.1.0
#addin nuget:?package=Wolfe.CommandLine&version=0.1.0
#tool nuget:?package=Wolfe.CommandLine&version=0.1.0
Wolfe.CommandLine
Wolfe.CommandLine is a set of utility extensions for the System.CommandLine package, including automatic completion registration.
Installation
Installation is as easy as just adding the package:
dotnet package add Wolfe.CommanLine
Usage
Tab completion
System.CommandLine does support suggestions out of the box using dotnet suggest, but they're not wired up anywhere. Your shell needs to know they
exist and how to access them, so this utility package puts that wiring in place with a completion command group.
using System.CommandLine;
using Wolfe.CommandLine.Completions;
var root = new RootCommand()
.AddCompletions("my-app");
This registers:
- the 'suggest' directive that the completion scripts call back into
- a
completioncommand group:my-app completion <shell>— emit the script (bash, zsh, fish, pwsh)my-app completion install <shell>— install itmy-app completion uninstall <shell>— remove it
How install works
Installation will pick a directory that the shell loads completions from automatically, if one is available, so no startup file is edited:
- fish —
~/.config/fish/completions/(always) - bash — the XDG bash-completion user directory (when the bash-completion package is present)
- zsh — a writable
$fpathdirectory, preferring brew'ssite-functions(when it exists)
When no such directory is available (always for pwsh), it falls back to a managed
# >>> my-app completion >>> block in the shell's startup file. Uninstall sweeps both.
The scripts are thin bridges: on tab they run my-app [suggest:<cursor>] "<line>" and feed the
candidates back to the shell, so completions always match the installed binary and never go stale.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. 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. |
-
net10.0
- System.CommandLine (>= 2.0.11)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.