-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Add dotnet tool exec
command for one-shot tool execution
#49329
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
Conversation
</data> | ||
<data name="ToolDownloadConfirmationPrompt" xml:space="preserve"> | ||
<value>Tool package {0}@{1} will be downloaded from source {2}. | ||
Proceed? [y/n]</value> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps we could reword this to be more localization friendly. Something like Press 'y' to proceed or 'n' to decline.
This way, we can translate proceed
and decline
, and lock the y/n keys from being localized. I imagine for non-Latin keyboards, we may need to translate the Y/N as well to display.
There was a problem hiding this 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 a good suggestion, but I personally prefer to be less verbose here.
src/Cli/dotnet/CliStrings.resx
Outdated
@@ -812,4 +812,7 @@ For a list of locations searched, specify the "-d" option before the tool name.< | |||
<value>Cannot specify --version when the package argument already contains a version.</value> | |||
<comment>{Locked="--version"}</comment> | |||
</data> | |||
<data name="YesOptionDescription" xml:space="preserve"> | |||
<value>Overrides confirmation prompt with "yes" value. </value> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should "yes"
not be translated? It sounds like a specific, non-localized value.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've updated how the confirmation prompt works and is localiized. I think the yes
string here can be localized.
src/Cli/dotnet/Commands/Tool/Execute/ToolExecuteCommandParser.cs
Outdated
Show resolved
Hide resolved
src/Cli/dotnet/Commands/Tool/Execute/ToolExecuteCommandParser.cs
Outdated
Show resolved
Hide resolved
toolExecutable, | ||
commandArguments); | ||
} | ||
else if (toolRunner == "executable") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: Redundant else
usage (both this else-if and the plain else).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's redundant but seems a bit clearer to me like this. If you get rid of the else
s you have to pay attention to the return statements inside the blocks to understand the overall flow.
@@ -812,4 +812,7 @@ For a list of locations searched, specify the "-d" option before the tool name.< | |||
<value>Cannot specify --version when the package argument already contains a version.</value> | |||
<comment>{Locked="--version"}</comment> | |||
</data> | |||
<data name="YesOptionDescription" xml:space="preserve"> | |||
<value>Overrides confirmation prompt with "yes" value. </value> | |||
</data> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
</data> | |
<comment>{Locked="yes"}</comment> | |
</data> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't actually think this needs to be locked, I've updated the confirmation prompt to support localization better.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't accept imply yes (whereas decline implies no)?
05ef93b
to
4bbafef
Compare
|
||
if (!_interactive) | ||
{ | ||
return false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good call to default to 'no' in this instance!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Per @baronfel, npx does it the other way 😀. So we still might change it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, that actually makes sense. No is better than no default, but I think we should change it too. It would make scripts more verbose. I don't see a scenario in CI where I'd write this but want to say no.
Co-authored-by: Michael Yanni <MiYanni@microsoft.com>
a46949c
to
ccde6b0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for sprucing up the code in some places. I read through everything and couldn't find any issues in the logic with the time we have before preview 6 snaps. All of the remaining feedback seems like nits to me - good feedback yet not blocking. Very excited to see this feature rollout :)
This is a continuation of this PR: #48443
Design doc: dotnet/designs#334
Original issue: #31103
Updates from previous PR include: