Skip to content

fix(ArgumentParser): Correct default programName when run via wrapper#233

Merged
bartelink merged 1 commit intofsprojects:masterfrom
bartelink:entry-program-name
Feb 28, 2024
Merged

fix(ArgumentParser): Correct default programName when run via wrapper#233
bartelink merged 1 commit intofsprojects:masterfrom
bartelink:entry-program-name

Conversation

@bartelink
Copy link
Copy Markdown
Member

When running via a wrapper such as dotnet or dotnet tool run (see #232 for more of the full scenario), the default logic derives the programName as dotnet, i.e. the exit error message becomes:

ERROR: unrecognized argument: 'equinox-common-test'.
USAGE: dotnet sync cosmos <snipped>

Another common case of this is that VS in ~2019 used to run in a wrapper, so the message would be correct if you Ctrl-F5 run, but not if you F5-run; who knows if that has changed...

@bartelink
Copy link
Copy Markdown
Member Author

This is prompted by me carted along messy code that overrides this for years.

I removed my shims recently, having erroneously assumed it was fixed, so I'm proposing this breaking change, for better or worse!

If anyone is concerned this is too heavy a change, then I can make a new static method to opt-in, as laid out in #171 (comment)

Copy link
Copy Markdown
Collaborator

@nojaf nojaf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is fine to have.
Thanks

@bartelink bartelink merged commit 5fb339f into fsprojects:master Feb 28, 2024
@bartelink bartelink deleted the entry-program-name branch February 28, 2024 10:50
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