forked from mvdan/sh
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
interp: display all Bash's
shopt
option
Trying to set an unsupported but valid Bash option leads to a potentially confusing error message: ``` $ gosh -c "shopt -s extglob" shopt: invalid option name "extglob" ``` Fix that by handling the unsupported options differently from the invalid ones: ``` $ gosh -c "shopt -s extglob" bash: line 1: shopt: extglob off ("on" not supported) exit status 1 ``` Additionally, this commit lists all of the Bash options when `shopt` without arguments is called and explicitly identify the unsupported options, for example: ``` $ gosh -c "shopt" | grep "not supported" checkwinsize on ("off" not supported) cmdhist on ("off" not supported) complete_fullquote on ("off" not supported) extquote on ("off" not supported) force_fignore on ("off" not supported) // .. cut for brevity xpg_echo on ("off" not supported) ``` While at it, rewrite the `bashOptsTable` so that it can keep two option states: 1) Bash's default options and 2) whether we support it Fixes mvdan#877
- Loading branch information
1 parent
5146d3e
commit 55b2812
Showing
4 changed files
with
176 additions
and
30 deletions.
There are no files selected for viewing
This file contains 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 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 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 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