dotnet / dotnet/command-line-api

add `Uri` to `ArgumentConverter.StringConverters`

Open
#2,574 5 comments 3 reactions 1 assignee Claimed by @jonsequitur View on GitHub
Dominant language
C#
Stars
3.7k
Forks
428
PR merge metrics
No merged PRs in 30d

Description

Right now, if you have:
```cs
public class UrlOption : Option
{
public UrlOption() : base("--url")
{
Required = true;
}
}
```

an `InvalidOperationException` is thrown, with the message:
```
Cannot parse argument 'http://example.com' for option '--url' as expected type 'System.Uri'.
```

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.