Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(Tests): Add learning/doc test re AltCommandLine -d #232

Merged
merged 1 commit into from
Feb 28, 2024

Conversation

bartelink
Copy link
Member

@bartelink bartelink commented Feb 28, 2024

I got tied up in knots suspecting a bug in Argu using locally installed dotnet tools (I always install globally and hence it just works)

Invocation was

propulsion sync cosmos -s $EQUINOX_COSMOS_CONNECTION -d $EQUINOX_COSMOS_DATABASE -c $EQUINOX_COSMOS_CONTAINER  \
    from cosmos -s $EQUINOX_COSMOS_CONNECTION -d sourcedb -c sourcecontainer

So I added naively added a dotnet before toolname to shut it up

Which resulted in a ERROR: unrecognized argument: 'equinox-common-test'. message

Which could only be fixed by replacing the two -d cases (which are AltCommandLine 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: dotnet/sdk#14626

The real solution until that issue is addressed in 14626 is to prefix local runs with dotnet tool run

@bartelink bartelink changed the title chore(Tests): Add learning/doc test re AltCommandLine chore(Tests): Add learning/doc test re AltCommandLine -d Feb 28, 2024
@bartelink bartelink merged commit 40e0e26 into fsprojects:master Feb 28, 2024
4 checks passed
@bartelink bartelink deleted the nestedaliases branch February 28, 2024 10:30
@bartelink
Copy link
Member Author

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants