Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide a better command example in case language option is used #4494

Closed
Tracked by #4887
vlada-shubina opened this issue Mar 21, 2022 · 2 comments
Closed
Tracked by #4887
Assignees
Labels
triaged The issue was evaluated by the triage team, placed on correct area, next action defined.
Milestone

Comments

@vlada-shubina
Copy link
Member

Currently, when option is not valid for certain template language, example suggested does not specify language.

> dotnet new webapi -minimal -lang F#
Error: Invalid option(s):
-minimal
   '-minimal' is not a valid option

For more information, run:
   dotnet new webapi -h

Improve the example: when the language is specified, example should contain the language too, i.e. for the example above
dotnet new webapi -h -lang F#

@vlada-shubina vlada-shubina added the triaged The issue was evaluated by the triage team, placed on correct area, next action defined. label Mar 28, 2022
@vlada-shubina vlada-shubina added this to the Backlog milestone Mar 28, 2022
@vlada-shubina vlada-shubina mentioned this issue Jun 23, 2022
26 tasks
@GangWang01 GangWang01 self-assigned this Sep 21, 2022
@GangWang01
Copy link
Member

When working on this another issue was found with .NET 7 (at least 7.0.100-preview.4.22252.9). dotnet new webapi -minimal -lang F# throws the exception below.

Unable to cast object of type 'System.Boolean' to type 'System.String'.
   at System.CommandLine.Binding.ArgumentConverter.GetValueOrDefault[T](ArgumentConversionResult result)
   at Microsoft.TemplateEngine.Cli.Commands.TemplateOptionResult.FromParseResult(TemplateOption option, ParseResult parseResult)
   at Microsoft.TemplateEngine.Cli.Commands.TemplateResult.FromParseResult(TemplateCommand templateCommand, ParseResult parseResult)
   at Microsoft.TemplateEngine.Cli.Commands.InstantiateCommand.CollectTemplateMatchInfo(InstantiateCommandArgs args, IEngineEnvironmentSettings environmentSettings, TemplatePackageManager templatePackageManager, TemplateGroup templateGroup)
   at Microsoft.TemplateEngine.Cli.Commands.InstantiateCommand.HandleNoTemplateFoundResult(InstantiateCommandArgs args, IEngineEnvironmentSettings environmentSettings, TemplatePackageManager templatePackageManager, TemplateGroup templateGroup, Reporter reporter)
   at Microsoft.TemplateEngine.Cli.Commands.InstantiateCommand.HandleTemplateInstantationAsync(InstantiateCommandArgs args, IEngineEnvironmentSettings environmentSettings, ITelemetryLogger telemetryLogger, TemplatePackageManager templatePackageManager, TemplateGroup templateGroup, CancellationToken cancellationToken)
   at Microsoft.TemplateEngine.Cli.Commands.InstantiateCommand.ExecuteIntAsync(InstantiateCommandArgs instantiateArgs, IEngineEnvironmentSettings environmentSettings, ITelemetryLogger telemetryLogger, InvocationContext context)
   at Microsoft.TemplateEngine.Cli.Commands.BaseCommand`1.InvokeAsync(InvocationContext context)

@GangWang01
Copy link
Member

Done in dotnet/sdk#28135

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
triaged The issue was evaluated by the triage team, placed on correct area, next action defined.
Projects
None yet
Development

No branches or pull requests

2 participants