Repository navigation
Releases
Releases · mvdan/sh
v2.2.0
Highlights:
- Tests on Mac and Windows are now ran as part of CI
- syntax
- Add
StopAtto stop lexing at a custom arbitrary token - Add
TranslatePatternandQuotePatternfor pattern matching - Minification support added to the printer - see
Minify - Add ParamExp.Names to represent
${!prefix*} - Add TimeClause.PosixFormat for its
-pflag - 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}
- Add
- 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
VarsandFuncs - Use the interpreter's
$PATHto find binaries - Roll our own globbing to use our own pattern matching code
- Support the
getoptssh builtin - Support the
readbash builtin - Numerous changes to improve Windows support
- Add Bash brace expansion support, including
- shell
- New experimental package with high-level utility functions
- Add
SourceFileto get the variables declared in a script - Add
SourceNodeas a lower-level version of the above
- cmd/shfmt
- Add
-mn, which minifies programs viasyntax.Minify
- Add
Binaries built on go version go1.9.2 linux/amd64.
v2.1.0
Highlights:
- syntax
- Add
Stmts, to parse one statement at a time - Walk no longer ignores comments
- Parameter expansion end fixes, such as
$foo.bar - Whitespace alignment can now be kept - see
KeepPadding - Introduce an internal newline token to simplify the parser
- Fix
Block.Posto actually return the start position - Fix mishandling of inline comments in two edge cases
- Add
- interp
- Expose
Fieldsto expand words into strings - First configurable modules - cmds and files
- Add support for the new
TimeClause - Add support for namerefs and readonly vars
- Add support for associative arrays (maps)
- More sh builtins:
exec return - More bash builtins:
command pushd popd dirs - More
testoperators:-b -c -t -o - Configurable kill handling - see
KillTimeout
- Expose
- cmd/shfmt
- Add
-fto just list all the shell files found - Add
-kpto keep the column offsets in place
- Add
- cmd/gosh
- Now supports a basic interactive mode
Binaries built on go version go1.9.2 linux/amd64.
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 -
Positionmerged intoPos - All comments are now attached to nodes
- Support
mksh- MirBSD's Korn Shell, used in Android - Various changes to the AST:
EvalClauseremoved;evalis no longer parsed as a keyword- Add support for Bash's
timeandselect - Merge
UntilClauseintoWhileClause - Moved
Stmt.AssignstoCallExpr.Assigns - Remove
Elif- chainIfClausenodes 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
-bnto put binary ops in the next line, like in v1 - Add
-cito 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.
v2.0-beta1
v1.3.1
Highlights:
- syntax
- Fix parsing of
${foo[$bar]} - Fix printer regression where
> >(foo)would be turned into>>(foo) - Break comment alignment on any line without a comment, fixing formatting issues
- Error on keywords like
fianddoneused as commands
- Fix parsing of
Binaries built on go version go1.8.3 linux/amd64.
v1.3.0
Highlights:
- syntax
- Fix backslashes in backquote command substitutions
- Disallow some test expressions like
[[ a == ! b ]] - Disallow some parameter expansions like
${$foo} - Disallow some arithmetic expressions like
((1=3))and(($(echo 1 + 2))) - Binary commands like
&&,||and pipes are now left-associative
- fileutil
CouldBeScriptmay now return true on non-regular files such as symlinks
- interp
- New experimental package to interpret a
syntax.Filein pure Go
- New experimental package to interpret a
Binaries built on go version go1.8.1 linux/amd64.
v1.2.0
Highlights:
- syntax
- Add support for escaped characters in bash regular expressions
- fileutil
- New package with some code moved from
cmd/shfmt, now importable - New funcs
HasShebangandCouldBeScript - Require shebangs to end with whitespace to reject
#!/bin/shfoo
- New package with some code moved from
Binaries built on go version go1.8 linux/amd64.
v1.1.0
Highlights:
- syntax
- Parse
[[ a = b ]]like[[ a == b ]], deprecatingTsAssgnin favour ofTsEqual - Add support for the
-k,-G,-Oand-Nunary operators inside[[ ]] - Add proper support for
!in parameter expansions, like${!foo} - Fix a couple of crashes found via fuzzing
- Parse
- cmd/shfmt
- Rewrite
[[ a = b ]]into the saner[[ a == b ]](see above)
- Rewrite
Binaries built on go version devel +a2b615d527 Thu Jan 5 15:37:37 2017 +0000 linux/amd64.
v1.0.0
v0.6.0
Highlights:
- syntax
Parsenow takes anio.Readerinstead of[]byte- Invalid UTF-8 is now reported as an error
- Remove backtracking for
$((and(( Walknow takes a func literal to simplify its use
Binaries built on go version devel +ed0b232 Mon Dec 5 03:53:56 2016 +0000 linux/amd64.