Permalink
Browse files

Minor updates to the Oil Quick Reference.

- Stub for a section on customizing the prompt string (in both OSH and
  Oil.)
  • Loading branch information...
Andy Chu
Andy Chu committed Jul 27, 2017
1 parent ad7d3df commit c39d9b2b73454049d6b444e661ba85068b6b8962
Showing with 47 additions and 7 deletions.
  1. +3 −0 build/compile.sh
  2. +10 −0 doc/oil-quick-ref-pages.txt
  3. +25 −7 doc/oil-quick-ref-toc.txt
  4. +8 −0 doc/osh-quick-ref-pages.txt
  5. +1 −0 doc/osh-quick-ref-toc.txt
View
@@ -222,6 +222,9 @@ build() {
|| true
popd
# TODO: Return proper exit code from this action
return 0
# NOTE:
# -l readline -l termcap -- for Python readline. Hm it builds without -l
# termcap.
@@ -70,6 +70,16 @@ first argument, e.g.:
## Same as oil --help, man oil
### <config> Configuration Files
### <startup> Shell Startup
### <line-editing> Line Editing
### <prompt> Customizing the Prompt String
TODO: Bash uses $PS1, $PS2, etc. Oil should use functions.
##### <COMMAND-LANGUAGE> Command Language
The command language is specified by the POSIX shell grammar.
View
@@ -6,7 +6,8 @@ Oil Quick Reference
INTRO
[Overview] overview cmd-vs-expr
[Usage] ovm-usage oil-usage config startup line-editing
[Usage] ovm-usage oil-usage config startup line-editing
prompt
COMMAND LANGUAGE
[Commands] simple-command semicolon ;
@@ -22,10 +23,11 @@ COMMAND LANGUAGE
block-redir redir > /dev/null then !2 > !1 { ls / }
here-doc << >>
desc !0 !1 !2 !stdin !stdout !stderr
feed (pass?) (for left to right syntax)
[Other] expr ( time coproc
ASSIGNING VARIABLES
[Keywords] var const set unset export
[Keywords] var const set setglobal unset export
shift # for compatibility
[Operators] assign str = 'xyz'
X append str += 'abc' array += [c d]
@@ -43,15 +45,24 @@ ASSIGNING VARIABLES
OIL EXTENSIONS
[Functions] func
types Int Float Str Array<Int> Array<Float> Array<Str>
[Blocks] cd {} redir {} with {}
[Data Frames] Literals and Operators
[Pipelines] nonlinear graph {} structured-data |>
[Modules] use (static modules)
[Other Tools] fs-expr -- like find
[Other Tools]
parallel -- like xargs
[Wok] begin end when -- like awk
[Boil] rule -- like make
[Data Types] Bool Int Float Str (utf-8 or bytes)
Array<Int> Array<Float> Array<Str>
List heterogeneous, for JSON
Dict
Table<...>
Null
PATTERN ACTION EXTENSIONS
[Wok] begin end when -- like awk
fs-expr -- like find, awk over FS metadata
flagparse -- some kind of block syntax
LIBRARIES
[Files] fd = open('foo.txt', 'w') # replacement for exec {fd}>foo.txt
@@ -78,14 +89,19 @@ WORD LANGUAGE
OTHER SHELL SUBLANGUAGES
[Expression] arith-intro Contexts where math is allowed
num-literals 0xFF 0755 etc.
powers of 2 Ki Mi Gi Ti
powers of 10 K M G T (not confused with true)
math 1 + 2*3
arith-logical not a and b
bitwise ~a ^ b This might change
arith-assign set a *= 2
table-expr t[name == 'foo',age]
list-expr mylist[1:2]
set-expr a .| b, a .& b
fs-expr test(:f)
comprehension [x for x in range(3) if x % 2 == 0]
{x: 1 for a in range(3)}
Set {x for a in range(3)}
{x: 1 for x in range(3)}
Set {x for x in range(3)}
[Patterns] glob *.py
X extglob @glob[*.py *.sh]
regex (foo ~ [a-z]+)
@@ -107,6 +123,8 @@ X [Word Lookup] command builtin
X [Introspection] help hash type caller
X [Interactive] bind history fc
X [External] test [ $a = $b ]
printf kill
env
[Compat Only] pushd popd dirs
SHELL OPTIONS
@@ -88,6 +88,14 @@ first argument, e.g.:
## Same as oil --help, man oil
### <config> Configuration Files
### <startup> Shell Startup
### <line-editing> Line Editing
### <prompt> Customizing the Prompt String
##### <COMMAND-LANGUAGE> Command Language
The command language is specified by the POSIX shell grammar.
@@ -7,6 +7,7 @@ OSH Quick Reference
INTRO
[Overview] overview
[Usage] osh-usage oil-usage config startup line-editing
prompt
COMMAND LANGUAGE
[Commands] simple-command semicolon ;

0 comments on commit c39d9b2

Please sign in to comment.