v2.0.0
Highlights:
- The package import paths were moved to
mvdan.cc/sh/...
- syntax
- Parser and Printer structs introduced with functional options
- Node positions are now independent -
Position
merged intoPos
- All comments are now attached to nodes
- Support
mksh
- MirBSD's Korn Shell, used in Android - Various changes to the AST:
EvalClause
removed;eval
is no longer parsed as a keyword- Add support for Bash's
time
andselect
- Merge
UntilClause
intoWhileClause
- Moved
Stmt.Assigns
toCallExpr.Assigns
- Remove
Elif
- chainIfClause
nodes instead
- Support for indexed assignments like
a[i]=b
- Allow expansions in arithmetic expressions again
- Unclosed heredocs now produce an error
- Binary ops are kept in the same line - see
BinaryNextLine
- Switch cases are not indented by default - see
SwitchCaseIndent
- cmd/shfmt
- Add
-s
, which simplifies programs viasyntax.Simplify
- Add
-ln <lang>
, like-ln mksh
- Add
-bn
to put binary ops in the next line, like in v1 - Add
-ci
to indent switch cases, like in v1
- Add
- interp
- Some progress made, though still experimental
- Most of POSIX done - some builtins remain to be done
Binaries built on go version go1.8.3 linux/amd64
.