Cannot pass negative doubles
brianharwell opened this issue · 10 comments
brianharwell commented
I have a simple command...
[Command("calculate")]
public class Calculate : ICommand
{
[CommandParameter(0, Name = "Latitude")]
public double Latitude { get; set; }
[CommandParameter(1, Name = "Longitude")]
public double Longitude { get; set; }
public ValueTask ExecuteAsync(IConsole console)
{
System.Console.WriteLine($"Latitude: {Latitude}");
System.Console.WriteLine($"Longitude: {Longitude}");
return default;
}
}
If I pass positive values it works...
.\Console.exe calculate 1 3
Latitude: 1
Longitude: 3
.\Console.exe calculate 1.6675 3.7655676
Latitude: 1.6675
Longitude: 3.7655676
If I pass negative numbers it fails...
.\Console.exe calculate -1.6675 -3.7655676
Missing value for parameter <Latitude>.
brianharwell commented
Even attempting to pass as strings fails...
.\Console.exe calculate "-1.6675" "-3.7655676"
Missing value for parameter <Latitude>.
adambajguz commented
brianharwell commented
Sweet thanks!
Tyrrrz commented
Np. I'll try to release a new version next week
brianharwell commented
@Tyrrrz Would you please cut a release with this fix?
Tyrrrz commented
@brianharwell v1.6 should already have it
brianharwell commented
@Tyrrrz i thought it might so I updated and the parsing still fails
Tyrrrz commented
@brianharwell can you share a command that fails? maybe i missed some edge case
brianharwell commented
@Tyrrrz It's good. The mistake was on my end. Thanks!
Tyrrrz commented
@brianharwell glad to hear!