dotnet / dotnet/templating

Passing `@` Symbol to String Parameter Causes Error

Open
#4,488 3 comments 0 reactions 0 assignees View on GitHub
area: CLI impeded triage:transfer-to-sdk triaged
Dominant language
No language data
Stars
1.7k
Forks
399
Avg merge
3d 5h
Merged PRs (30d)
39

Description

When I pass an `@` symbol as the first character in a string parameter I get an error saying I have passed an empty string and that its not a valid value. I should be

```powershell
dotnet new nuget --contact '@RehanSaeed'
Error: Invalid option(s):
--contact
'' is not a valid value for --contact.

For usage information, run:
dotnet new -h
```

This is how the above string parameter is setup:

template.json
```json
"Contact": {
"type": "parameter",
"datatype": "string",
"defaultValue": "[user@example.com|@ExampleUser]",
"replaces": "PROJECT-CONTACT",
"description": "The contact details to use if someone wants to contact you about a security vulnerability or code of conduct issues."
}
```

dotnetcli.host.json
```json
"Contact": {
"longName": "contact"
}
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.