Closed bartelink closed 6 months ago
One more way of getting stung by the same thing is to naively do dotnet run toolname <args>
, which, for the above yields:
(coz dotnet run
has a -c
switch but no -d
!)
System.InvalidOperationException: Option '-c' only accepts a single argument but 2 were provided.
at System.CommandLine.Binding.ArgumentConverter.GetValueOrDefault[T](ArgumentConversionResult result)
at System.CommandLine.Parsing.OptionResult.GetValueOrDefault[T]()
at System.CommandLine.Parsing.SymbolResult.GetValueForOption(Option option)
at System.CommandLine.ParseResult.GetValueForOption(Option option)
I got tied up in knots suspecting a bug in Argu using locally installed
dotnet tool
s (I always install globally and hence it just works)Invocation was
So I added naively added a
dotnet
beforetoolname
to shut it upWhich resulted in a
ERROR: unrecognized argument: 'equinox-common-test'.
messageWhich could only be fixed by replacing the two
-d
cases (which areAltCommandLine
aliases) with the raw name (--database
)Hence this test, which proves nothing new, except that it's pretty naive to assume that Eirik left some wacky bugs in here!
Of course the actual problem is my stupidity, which has a proposed solution: https://github.com/dotnet/sdk/issues/14626
The real solution until that issue is addressed in 14626 is to prefix local runs with
dotnet tool run