GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||
GeezerVison is showing github.com — Make error message consistent when invalid script is passed to -File, better error when passed ambiguous arg by SteveL-MSFT · Pull Request #4573 · PowerShell/PowerShell Conversation
|
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
I believe argument is better term and we can be shorter:
The argument '{0}' is not recognized as the name of a script file.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Will change
Sorry, something went wrong.
There was an error while loading. Please reload this page.
e18b241 to
d6d9505
Compare
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Should this be validParameter.StartsWith(param, StringComparer.OrdinalIgnoreCase)?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
I was thinking to cover cases like: -format
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
I'll add a test case for this
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
I'd indent with spaces - we don't indent with tabs anywhere else that I know of.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
will change
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Showing the banner after the error is weird and not like the other errors I reviewed.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
I thought that was weird in general, but it seems consistent with other uses of WriteCommandLineError. Unless you know the reason it was like this, I'll change all uses to not show the banner.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
a9d0bac to
cb97564
Compare
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Leave a comment
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
#if !CORECLR is no longer relevant. Should we remove the parameters at all?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
I'm fixing that as part of enabling ApartmentState PR and not part of this PR
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Closed.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Maybe
#if !UNIX
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
makes sense
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
"did you mean:" - Do you want add something else?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
The possible matches show up after this. See example above in the PR description.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Closed.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
We should exclude this on Unix.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
will do
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
All tests is excluded on Unix so we could use our pattern "$PSDefaultParameterValues["it:skip"] = ..."
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
agree
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Parentheses can be removed.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Will remove
Sorry, something went wrong.
There was an error while loading. Please reload this page.
eb660da to
951832a
Compare
There was an error while loading. Please reload this page.
|
Not sure why some of the new tests fail in AppVeyor but not on my desktop. Figured it out, need to redirect stderr to stdout. However, I noticed the tests fail on Mac because the exit code isn't being set, but still shows as passed overall. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
bb83bb5 to
ab1862b
Compare
|
Figured out why it's failing on non-Windows. It appears that exit codes from programs have to be in the range 0-255 and anything greater than 255 is mod 256. I verified this with a simple console c# app. In this case, the value for ExitCodeBadCommandLineParameter mod 256 == 0. Hmmm. Although a breaking change, I think we should conform to libc standards which means this error code should be 64 "command line usage error". We should also update all the other error codes that powershell console returns. In general, I don't think this should be a problem as typically 0 means success and non-0 means error so although a breaking change, I suspect it have limited real world impact. cc @PowerShell/powershell-committee |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
be79184 to
5c6b694
Compare
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
I approve the changes, but there are 2 distinct fixes in the PR, so I think there should be 2 distinct commits.
Interactive add (git add -p) is an easy way to do that.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Jason Shirk (@lzybkr) are you referring to -WindowStyle and everything else as two commits? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Yeah, |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Jason Shirk (@lzybkr) sure, I can make that two commits in the same PR. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Improve error message if ambiguous arg is passed to -File
5c6b694 to
26f7db7
Compare
|
Split into 3 commits (Thanks Jason Shirk (@lzybkr) for the tip on |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@PowerShell/powershell-committee reviewed this and is ok with changing the exit codes |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
Ilya (@iSazonov), Jason Shirk (@lzybkr) and Steve Lee (@SteveL-MSFT) thanks as always! |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
* Make invalid arg to -File consistent with -Command Improve error message if ambiguous arg is passed to -File * Update powershell console exit codes to match Unix standards * Enable -WindowStyle to work
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.