sh v2.2.0 Release Notes

Release Date: 2018-01-18 // over 6 years ago
  • Highlights:

    • 🏁 Tests on Mac and Windows are now ran as part of CI
    • syntax
      • Add StopAt to stop lexing at a custom arbitrary token
      • Add TranslatePattern and QuotePattern for pattern matching
      • Minification support added to the printer - see Minify
      • Add ParamExp.Names to represent ${!prefix*}
      • Add TimeClause.PosixFormat for its -p flag
      • Fix parsing of assignment values containing =
      • Fix parsing of parameter expansions followed by a backslash
      • Fix quotes in parameter expansion operators like ${v:-'def'}
      • Fix parsing of negated declare attributes like declare +x name
      • Fix parsing of ${#@}
      • Reject bad parameter expansion operators like ${v@WRONG}
      • Reject inline array variables like a=(b c) prog
      • Reject indexing of special vars like ${1[3]}
      • Reject ${!name} when in POSIX mode
      • Reject multiple parameter expansion actions like ${#v:-def}
    • interp
      • Add Bash brace expansion support, including {a,b} and {x..y}
      • Pattern matching actions are more correct and precise
      • Exported some Runner internals, including Vars and Funcs
      • Use the interpreter's $PATH to find binaries
      • Roll our own globbing to use our own pattern matching code
      • Support the getopts sh builtin
      • Support the read bash builtin
      • Numerous changes to improve Windows support
    • shell
      • New experimental package with high-level utility functions
      • Add SourceFile to get the variables declared in a script
      • Add SourceNode as a lower-level version of the above
    • cmd/shfmt
      • Add -mn, which minifies programs via syntax.Minify