-
Notifications
You must be signed in to change notification settings - Fork 1
fix(builtins): --help must exit 0 for help, break, and continue #150
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
Closed
Closed
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| # skip_assert_against_bash: true — intentional divergence from bash. | ||
| # Bash returns exit code 2 for "break --help"; rshell returns 0 per project | ||
| # convention (RULES.md: "When --help is passed: Set exit code 0 and return"). | ||
| description: break --help prints usage and exits zero. | ||
| skip_assert_against_bash: true | ||
| input: | ||
| script: |+ | ||
| break --help | ||
| expect: | ||
| stdout_contains: ["break: break [n]"] | ||
| stderr: "" | ||
| exit_code: 0 |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| # skip_assert_against_bash: true — intentional divergence from bash. | ||
| # Bash returns exit code 2 for "break -h"; rshell returns 0 per project | ||
| # convention (RULES.md: "When --help is passed: Set exit code 0 and return"). | ||
| description: break -h prints usage and exits zero. | ||
| skip_assert_against_bash: true | ||
| input: | ||
| script: |+ | ||
| break -h | ||
| expect: | ||
| stdout_contains: ["break: break [n]"] | ||
| stderr: "" | ||
| exit_code: 0 |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| # skip_assert_against_bash: true — intentional divergence from bash. | ||
| # Bash returns exit code 2 for "continue --help"; rshell returns 0 per project | ||
| # convention (RULES.md: "When --help is passed: Set exit code 0 and return"). | ||
| description: continue --help prints usage and exits zero. | ||
| skip_assert_against_bash: true | ||
| input: | ||
| script: |+ | ||
| continue --help | ||
| expect: | ||
| stdout_contains: ["continue: continue [n]"] | ||
| stderr: "" | ||
| exit_code: 0 |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| # skip_assert_against_bash: true — intentional divergence from bash. | ||
| # Bash returns exit code 2 for "continue -h"; rshell returns 0 per project | ||
| # convention (RULES.md: "When --help is passed: Set exit code 0 and return"). | ||
| description: continue -h prints usage and exits zero. | ||
| skip_assert_against_bash: true | ||
| input: | ||
| script: |+ | ||
| continue -h | ||
| expect: | ||
| stdout_contains: ["continue: continue [n]"] | ||
| stderr: "" | ||
| exit_code: 0 |
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,8 +1,12 @@ | ||
| # skip_assert_against_bash: true — intentional divergence from bash. | ||
| # Bash returns exit code 2 for "break --help"; rshell returns 0 per project | ||
| # convention (RULES.md: "When --help is passed: Set exit code 0 and return"). | ||
| description: Break --help displays usage information. | ||
| skip_assert_against_bash: true | ||
|
thieman marked this conversation as resolved.
|
||
| input: | ||
| script: |+ | ||
| for i in 1; do break --help; done | ||
| expect: | ||
| stdout: "break: break [n]\n Exit for, while, or until loops.\n \n Exit a FOR, WHILE or UNTIL loop. If N is specified, break N enclosing\n loops.\n \n Exit Status:\n The exit status is 0 unless N is not greater than or equal to 1.\n" | ||
| stderr: "" | ||
| exit_code: 2 | ||
| exit_code: 0 | ||
6 changes: 5 additions & 1 deletion
6
tests/scenarios/shell/for_clause/break_cont/continue_help.yaml
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,8 +1,12 @@ | ||
| # skip_assert_against_bash: true — intentional divergence from bash. | ||
| # Bash returns exit code 2 for "continue --help"; rshell returns 0 per project | ||
| # convention (RULES.md: "When --help is passed: Set exit code 0 and return"). | ||
| description: Continue --help displays usage information. | ||
| skip_assert_against_bash: true | ||
| input: | ||
| script: |+ | ||
| for i in 1; do continue --help; done | ||
| expect: | ||
| stdout: "continue: continue [n]\n Resume for, while, or until loops.\n \n Resumes the next iteration of the enclosing FOR, WHILE or UNTIL loop.\n If N is specified, resumes the Nth enclosing loop.\n \n Exit Status:\n The exit status is 0 unless N is not greater than or equal to 1.\n" | ||
| stderr: "" | ||
| exit_code: 2 | ||
| exit_code: 0 |
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.