Skip to content

Commit ca5badd

Browse files
authored
Fix MapCommandName DI bug (#60)
* fix bug where command wasn't getting registered when MapCommandName(options) was called
1 parent dec3162 commit ca5badd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/System.CommandLine.Minimal.SourceGenerator/CommandOptionsWriter.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public static class Configure{{binder.CommandNameTitleCase}}BuilderExtensions
4747
);
4848
// do not add the class to services if it's static
4949
if (!binder.MethodIsStatic)
50-
sb.AppendLine($" builder.Services.TryAddTransient<{binder.CommandOptionsName}>();");
50+
sb.AppendLine($" builder.Services.TryAddTransient<{binder.FullClassName}>();");
5151
sb.AppendLine(
5252
$$"""
5353
{{binder.CommandOptionsName}} cliOptions = builder.TryRegisterCommandOptions<{{binder.CommandOptionsName}}>();

0 commit comments

Comments
 (0)