OILS / _devbuild / help / shell-flags View on Github | oils.pub

33 lines, 24 significant
1osh and ysh accept standard POSIX shell flags, like:
2
3 bin/osh -o errexit -c 'false'
4 bin/ysh -n myfile.ysh
5 bin/ysh +o errexit -c 'false; echo ok'
6
7They also accept these flags:
8
9 --eval FILE
10 Evaluate the given file, similar to the 'source' builtin. Specify it
11 multiple times to run multiple files. If the errexit option is on
12 (e.g. in YSH), then the shell stops when $? is non-zero after
13 evaluating a file.
14
15 --eval-pure FILE
16 Like --eval, but disallow I/O (known as "pure mode").
17
18 --location-str
19 Use this string to display error messages.
20 See 'help sourceCode' for an example.
21
22 --location-start-line
23 Use this line number offset to display error messages.
24
25 --tool Run a tool instead of the shell (cat-em|syntax-tree)
26 -n Parse the program but don't execute it. Print the AST.
27 --ast-format FMT The format for the AST (text|text-abbrev)
28
29Examples:
30
31 ysh --eval one.ysh --eval two.ysh -c 'echo hi' # Run 2 files first
32 osh -n -c 'hello' # pretty-print the AST
33 ysh --ast-format text -n -c 'hello' # in unabridged format