diff --git a/src/EntryPoint/Arguments/ArgumentMapper.cs b/src/EntryPoint/Arguments/ArgumentMapper.cs index 363181b..b02eb27 100644 --- a/src/EntryPoint/Arguments/ArgumentMapper.cs +++ b/src/EntryPoint/Arguments/ArgumentMapper.cs @@ -108,7 +108,7 @@ static void ValidateTokensForDuplicateOptions(ArgumentModel model, List o.LongName))}"); } } diff --git a/src/EntryPoint/Arguments/ArgumentModel.cs b/src/EntryPoint/Arguments/ArgumentModel.cs index 6ce3e88..612e640 100644 --- a/src/EntryPoint/Arguments/ArgumentModel.cs +++ b/src/EntryPoint/Arguments/ArgumentModel.cs @@ -86,8 +86,8 @@ void ValidateContigiousOperandMapping() { // Position should always increase by 1 } else if (diff != 1) { - throw new InvalidModelException("Non-contiguous Operand Positions. " - + $"Operand positions should cover every position from min->max. {position} and {lastPosition} were next to each other"); + throw new InvalidModelException("Missing Operand Position(s). " + + $"Operand positions should always increment by 1 from first->last. Positions {position} and {lastPosition} leave a gap"); } lastPosition = position; diff --git a/src/EntryPoint/Arguments/OptionStrategies/OptionStrategy.cs b/src/EntryPoint/Arguments/OptionStrategies/OptionStrategy.cs index 8f81210..25ead5d 100644 --- a/src/EntryPoint/Arguments/OptionStrategies/OptionStrategy.cs +++ b/src/EntryPoint/Arguments/OptionStrategies/OptionStrategy.cs @@ -41,8 +41,9 @@ bool HasDoubleOption(Token arg, BaseOptionAttribute definition) { object CheckValue(bool value, Type outputType, BaseOptionAttribute definition) { if (outputType != typeof(bool)) { throw new InvalidOperationException( - $"The type of {Cli.DASH_DOUBLE}{definition.LongName} on the ArgumentsModel, " - + $"must be a boolean for {nameof(OptionAttribute)}"); + $"The type of {Cli.DASH_DOUBLE}{definition.LongName} on the ArgumentsModel, " + + $"must be a boolean for {nameof(OptionAttribute)}. " + + $"For variable Options, you can use {nameof(OptionParameterAttribute)}"); } return value; } diff --git a/src/EntryPoint/CommandAttribute.cs b/src/EntryPoint/CommandAttribute.cs index 9122f35..4f1f396 100644 --- a/src/EntryPoint/CommandAttribute.cs +++ b/src/EntryPoint/CommandAttribute.cs @@ -21,7 +21,7 @@ public class CommandAttribute : Attribute { public CommandAttribute(string Name) { if (Name == null || Name.Length == 0) { throw new ArgumentException( - "You must give a Command a name"); + $"A {nameof(CommandAttribute)} was not given a name"); } this.Name = Name; } diff --git a/test/Example/Properties/launchSettings.json b/test/Example/Properties/launchSettings.json index aeb782b..65923d0 100644 --- a/test/Example/Properties/launchSettings.json +++ b/test/Example/Properties/launchSettings.json @@ -21,6 +21,10 @@ "SecondaryCommand": { "commandName": "Project", "commandLineArgs": "Secondary \"operand one\" two three" + }, + "CheckCommandDefaultError": { + "commandName": "Project", + "commandLineArgs": "one two three" } } } \ No newline at end of file