Skip to content

Releases: mvdan/sh

v2.1.0

Choose a tag to compare

@mvdan mvdan released this 25 Nov 18:17

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.Pos to actually return the start position
    • Fix mishandling of inline comments in two edge cases
  • interp
    • Expose Fields to 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 test operators: -b -c -t -o
    • Configurable kill handling - see KillTimeout
  • cmd/shfmt
    • Add -f to just list all the shell files found
    • Add -kp to keep the column offsets in place
  • cmd/gosh
    • Now supports a basic interactive mode

Binaries built on go version go1.9.2 linux/amd64.

v2.0.0

Choose a tag to compare

@mvdan mvdan released this 30 Aug 16:03

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

Binaries built on go version go1.8.3 linux/amd64.

v2.0-beta1

v2.0-beta1 Pre-release
Pre-release

Choose a tag to compare

@mvdan mvdan released this 30 Jul 12:50

See #144.

v1.3.1

Choose a tag to compare

@mvdan mvdan released this 26 May 13:50

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 fi and done used as commands

Binaries built on go version go1.8.3 linux/amd64.

v1.3.0

Choose a tag to compare

@mvdan mvdan released this 24 Apr 16:47

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
    • CouldBeScript may now return true on non-regular files such as symlinks
  • interp
    • New experimental package to interpret a syntax.File in pure Go

Binaries built on go version go1.8.1 linux/amd64.

v1.2.0

Choose a tag to compare

@mvdan mvdan released this 22 Feb 12:22

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 HasShebang and CouldBeScript
    • Require shebangs to end with whitespace to reject #!/bin/shfoo

Binaries built on go version go1.8 linux/amd64.

v1.1.0

Choose a tag to compare

@mvdan mvdan released this 05 Jan 19:32

Highlights:

  • syntax
    • Parse [[ a = b ]] like [[ a == b ]], deprecating TsAssgn in favour of TsEqual
    • Add support for the -k, -G, -O and -N unary operators inside [[ ]]
    • Add proper support for ! in parameter expansions, like ${!foo}
    • Fix a couple of crashes found via fuzzing
  • cmd/shfmt
    • Rewrite [[ a = b ]] into the saner [[ a == b ]] (see above)

Binaries built on go version devel +a2b615d527 Thu Jan 5 15:37:37 2017 +0000 linux/amd64.

v1.0.0

Choose a tag to compare

@mvdan mvdan released this 13 Dec 15:04

Highlights:

  • syntax
    • Stable release, API now frozen
    • Parse now reads input in chunks of 1KiB
  • cmd/shfmt
    • Add -version flag

Binaries built on go version devel +3fb1e0b Tue Dec 13 13:42:41 2016 +0000 linux/amd64.

v0.6.0

v0.6.0 Pre-release
Pre-release

Choose a tag to compare

@mvdan mvdan released this 05 Dec 15:31

Highlights:

  • syntax
    • Parse now takes an io.Reader instead of []byte
    • Invalid UTF-8 is now reported as an error
    • Remove backtracking for $(( and ((
    • Walk now 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.

v0.5.0

v0.5.0 Pre-release
Pre-release

Choose a tag to compare

@mvdan mvdan released this 24 Nov 22:32

Highlights:

  • cmd/shfmt
    • Remove -cpuprofile
    • Don't read entire files into memory to check for a shebang
  • syntax
    • Use uint32 for tokens and positions in nodes
    • Use Word and Lit pointers consistently instead of values
    • Ensure Word.Parts is never empty
    • Add support for expressions in array indexing and parameter expansion slicing

Binaries built on go version devel +a2bd5c5 Thu Nov 24 03:48:45 2016 +0000 linux/amd64.