Repository navigation
Add testexe.exe -echocmdline to output raw command line received by the process on Windows
#18591
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
Merged
Dongbo Wang (daxian-dbw)
merged 5 commits into
PowerShell:master
from
daxian-dbw:echoarg
Dec 6, 2022
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
a7ce726
Update `testexe.exe -echoargs` to output raw comamnd line received by…
daxian-dbw 6de1fc6
Update
daxian-dbw d5dabe1
Address feedback
daxian-dbw b6342cd
Fix CodeFactor issue
daxian-dbw 512d43c
Return exit code for invalid argument
daxian-dbw File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Would it make more sense to return a non-zero exit code and write message to StdErr?
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.
What is the purpose of doing this? Do you have some testing scenarios in mind that would need 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.
It is what any well-behaved CLI should do: print error messages to stderr, indicate failure via a non-zero exit code. Except in cases where backward compatibility must (unfortunately) be maintained, there's no good reason not to do this.
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 agree with Michael Klement (@mklement0), even though this is a test tool, we want to set good examples as other folks may end up using this code for their own projects.
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'm afraid I need some clarification on this.
Are you suggesting returning non-zero exit code and write an error message instead of just writing out
N/Awhen running on non-windows? The initial comment looks like suggesting always doing that.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.
If I understood Steve Lee (@SteveL-MSFT) correctly, his comment was solely related to this unrelated piece of code, which deals with passing an unknown test name to the utility (the cited code originally showed that).
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.
Steve Lee (@SteveL-MSFT) Is that what you mean?
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 have updated that piece of code based on the feedback. Please let me know if you mean something else.