Skip to content

Commit a2a92bd

Browse files
0xcedpatriksvensson
authored andcommitted
Fix erroneous missing required option error message
Probably a copy/paste error since the messages for the default command say "Missing required option" vs "Missing required argument"
1 parent 77da931 commit a2a92bd

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

‎src/Spectre.Console.Cli.Tests/CommandAppTests.Options.cs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public void Should_Throw_If_Required_Option_Is_Missing()
2121
// Then
2222
result.ShouldBeOfType<CommandRuntimeException>()
2323
.And(ex =>
24-
ex.Message.ShouldBe("Command 'test' is missing required argument 'foo'."));
24+
ex.Message.ShouldBe("Command 'test' is missing required option 'foo'."));
2525
}
2626
}
2727
}

‎src/Spectre.Console.Cli/CommandRuntimeException.cs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ internal static CommandRuntimeException MissingRequiredOption(CommandTree node,
4444
return new CommandRuntimeException($"Missing required option '{option.GetOptionName()}'.");
4545
}
4646

47-
return new CommandRuntimeException($"Command '{node.Command.Name}' is missing required argument '{option.GetOptionName()}'.");
47+
return new CommandRuntimeException($"Command '{node.Command.Name}' is missing required option '{option.GetOptionName()}'.");
4848
}
4949

5050
internal static CommandRuntimeException NoConverterFound(CommandParameter parameter)

0 commit comments

Comments
 (0)