Skip to content

Commit

Permalink
[bin/osh] Allow osh -O all:oil and all:strict
Browse files Browse the repository at this point in the history
And minor doc updates.
  • Loading branch information
Andy Chu committed Aug 22, 2019
1 parent 0650743 commit a2ec441
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 4 deletions.
6 changes: 3 additions & 3 deletions doc/oil-manual.md
Expand Up @@ -243,9 +243,9 @@ flags, as well as the `--` separator between flags and args.
Append one or more strings to an array.

```
var array = @(a 'b c')
push :array d e
echo @array # prints 'ab cde'
var array = @(1 '2 two')
push :array three four
echo @array # prints 4 lines
```

#### Future
Expand Down
2 changes: 2 additions & 0 deletions doc/osh-quick-ref-toc.txt
Expand Up @@ -119,6 +119,8 @@ X [Unsupported] enable
X dirname X basename optimizations
push sugar for 'do array.push( @(a b) )'
repr Show debug representation of vars
X json-echo X json-read
X tsv2-echo X tsv2-read

SHELL OPTIONS
[Errors] nounset pipefail errexit inherit_errexit
Expand Down
2 changes: 1 addition & 1 deletion osh/builtin_pure.py
Expand Up @@ -101,7 +101,7 @@ def AddOptionsToArgSpec(spec):
for short_flag, opt_name in state.SET_OPTIONS:
spec.Option(short_flag, opt_name)

for shopt_name in state.ALL_SHOPT_OPTIONS:
for shopt_name in state.ALL_SHOPT_OPTIONS + state.META_OPTIONS:
spec.ShoptOption(shopt_name)


Expand Down
2 changes: 2 additions & 0 deletions osh/state.py
Expand Up @@ -225,6 +225,8 @@ def Disable(self):
# Used in builtin_pure.py
ALL_SHOPT_OPTIONS = SHOPT_OPTION_NAMES + _PARSE_OPTION_NAMES

META_OPTIONS = ['all:oil', 'all:strict'] # Passed to flag parser


class ExecOpts(object):

Expand Down
8 changes: 8 additions & 0 deletions spec/oil-options.test.sh
Expand Up @@ -168,3 +168,11 @@ shopt -s parse-equals
shopt -s parse-paren
shopt -s parse-set
## END

#### osh -O all:oil
$SH -O all:oil -c 'var x = @(one two three); echo @x'
## STDOUT:
one
two
three
## END

0 comments on commit a2ec441

Please sign in to comment.