sh v2.0.0 Release Notes

Release Date: 2017-08-30 // over 6 years ago
  • 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 into Pos
      • 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 and select
      • Merge UntilClause into WhileClause
      • Moved Stmt.Assigns to CallExpr.Assigns
      • Remove Elif - chain IfClause 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 via syntax.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
    • interp
      • Some progress made, though still experimental
      • Most of POSIX done - some builtins remain to be done