dotnet / dotnet/command-line-api

Accessing global options

Open
#1,695 6 comments 0 reactions 0 assignees View on GitHub
Dominant language
C#
Stars
3.7k
Forks
428
PR merge metrics
No merged PRs in 30d

Description

I don't see how to handle global options with the new 2.0 API.

```

var cmd = //... some Command, the RootCommand is somewhere else created, not accessible here
var arg = new Argument("x", "Mysterious x");

cmd.SetHandler(async (string x) =>
{
await DoSomething(x);
},
someArgument);`

```
**Question:** How to access/fill global options in this case?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.