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

34 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.
12
13 If the errexit option is on (e.g. in YSH), then the shell stops when $?
14 is non-zero after evaluating a file. The $0 value is set to FILE.
15
16 --eval-pure FILE
17 Like --eval, but disallow I/O (known as "pure mode").
18
19 --location-str
20 Use this string to display error messages.
21 See 'help sourceCode' for an example.
22
23 --location-start-line
24 Use this line number offset to display error messages.
25
26 --tool Run a tool instead of the shell (cat-em|syntax-tree)
27 -n Parse the program but don't execute it. Print the AST.
28 --ast-format FMT The format for the AST (text|text-abbrev)
29
30Examples:
31
32 ysh --eval one.ysh --eval two.ysh -c 'echo hi' # Run 2 files first
33 osh -n -c 'hello' # pretty-print the AST
34 ysh --ast-format text -n -c 'hello' # in unabridged format