(command.CommandList
  children: [
    (C {(KW_Set set)} {(-e)})
    (command.ShFunction
      name: version
      body: (command.BraceGroup children:[(C {(echo)} {(DQ ('Bats 0.4.0'))})])
    )
    (command.ShFunction
      name: usage
      body: 
        (command.BraceGroup
          children: [
            (C {(version)})
            (C {(echo)} {(DQ ('Usage: bats [-c] [-p | -t] <test> [<test> ...]'))})
          ]
        )
    )
    (command.ShFunction
      name: help
      body: 
        (command.BraceGroup
          children: [
            (C {(usage)})
            (C {(echo)})
            (C {(echo)} {(DQ ('  <test> is the path to a Bats test file, or the path to a directory'))})
            (C {(echo)} {(DQ ('  containing Bats test files.'))})
            (C {(echo)})
            (C {(echo)} 
              {(DQ ('  -c, --count    Count the number of test cases without running any tests'))}
            )
            (C {(echo)} {(DQ ('  -h, --help     Display this help message'))})
            (C {(echo)} 
              {(DQ ('  -p, --pretty   Show results in pretty format (default for terminals)'))}
            )
            (C {(echo)} {(DQ ('  -t, --tap      Show results in TAP format'))})
            (C {(echo)} {(DQ ('  -v, --version  Display the version number'))})
            (C {(echo)})
            (C {(echo)} {(DQ ('  For more information, see https://github.com/sstephenson/bats'))})
            (C {(echo)})
          ]
        )
    )
    (command.ShFunction
      name: resolve_link
      body: 
        (command.BraceGroup
          children: [
            (C 
              {
                (command_sub
                  left_token: <Left_DollarParen '$('>
                  command_list: 
                    (command.CommandList
                      children: [
                        (command.Pipeline
                          children: [(C {(type)} {(-p)} {(greadlink)} {(readlink)}) (C {(head)} {(-1)})]
                          negated: F
                        )
                      ]
                    )
                )
              } {(DQ ($ VSub_Number '$1'))}
            )
          ]
        )
    )
    (command.ShFunction
      name: abs_dirname
      body: 
        (command.BraceGroup
          children: [
            (C {(local)} 
              {(Lit_VarLike 'cwd=') 
                (DQ 
                  (command_sub
                    left_token: <Left_DollarParen '$('>
                    command_list: (command.CommandList children:[(C {(pwd)})])
                  )
                )
              }
            )
            (C {(local)} {(Lit_VarLike 'path=') (DQ ($ VSub_Number '$1'))})
            (command.WhileUntil
              keyword: <KW_While while>
              cond: [
                (command.Sentence
                  child: 
                    (C {(Lit_LBracket '[')} {(-n)} {(DQ ($ VSub_DollarName '$path'))} 
                      {(Lit_RBracket ']')}
                    )
                  terminator: <Op_Semi ';'>
                )
              ]
              body: 
                (command.DoGroup
                  children: [
                    (C {(cd)} 
                      {
                        (DQ 
                          (braced_var_sub
                            token: <VSub_Name path>
                            suffix_op: 
                              (suffix_op.Unary
                                op_id: VOp1_Percent
                                arg_word: {(Lit_Slash /) ('*')}
                              )
                          )
                        )
                      }
                    )
                    (C {(local)} 
                      {(Lit_VarLike 'name=') 
                        (DQ 
                          (braced_var_sub
                            token: <VSub_Name path>
                            suffix_op: 
                              (suffix_op.Unary
                                op_id: VOp1_DPound
                                arg_word: {('*') (Lit_Slash /)}
                              )
                          )
                        )
                      }
                    )
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:path)
                          op: Equal
                          rhs: 
                            {
                              (DQ 
                                (command_sub
                                  left_token: <Left_DollarParen '$('>
                                  command_list: 
                                    (command.CommandList
                                      children: [
                                        (command.AndOr
                                          ops: [Op_DPipe]
                                          children: [
                                            (C {(resolve_link)} {(DQ ($ VSub_DollarName '$name'))})
                                            (C {(true)})
                                          ]
                                        )
                                      ]
                                    )
                                )
                              )
                            }
                        )
                      ]
                    )
                  ]
                )
            )
            (C {(pwd)})
            (C {(cd)} {(DQ ($ VSub_DollarName '$cwd'))})
          ]
        )
    )
    (command.ShFunction
      name: expand_path
      body: 
        (command.BraceGroup
          children: [
            (command.AndOr
              ops: [Op_DPipe]
              children: [
                (command.BraceGroup
                  children: [
                    (command.Simple
                      words: [
                        {(cd)}
                        {
                          (DQ 
                            (command_sub
                              left_token: <Left_DollarParen '$('>
                              command_list: 
                                (command.CommandList
                                  children: [(C {(dirname)} {(DQ ($ VSub_Number '$1'))})]
                                )
                            )
                          )
                        }
                      ]
                      redirects: [(redir.Redir op:<Redir_Great '2>'> fd:2 arg_word:{(/dev/null)})]
                    )
                    (C {(local)} {(Lit_VarLike 'dirname=') (DQ ($ VSub_DollarName '$PWD'))})
                    (C {(cd)} {(DQ ($ VSub_DollarName '$OLDPWD'))})
                    (C {(echo)} 
                      {
                        (DQ ($ VSub_DollarName '$dirname') (/) 
                          (command_sub
                            left_token: <Left_DollarParen '$('>
                            command_list: 
                              (command.CommandList
                                children: [(C {(basename)} {(DQ ($ VSub_Number '$1'))})]
                              )
                          )
                        )
                      }
                    )
                  ]
                )
                (C {(echo)} {(DQ ($ VSub_Number '$1'))})
              ]
            )
          ]
        )
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:BATS_LIBEXEC)
          op: Equal
          rhs: 
            {
              (DQ 
                (command_sub
                  left_token: <Left_DollarParen '$('>
                  command_list: 
                    (command.CommandList
                      children: [(C {(abs_dirname)} {(DQ ($ VSub_Number '$0'))})]
                    )
                )
              )
            }
        )
      ]
    )
    (C {(export)} 
      {(Lit_VarLike 'BATS_PREFIX=') 
        (DQ 
          (command_sub
            left_token: <Left_DollarParen '$('>
            command_list: 
              (command.CommandList
                children: [(C {(abs_dirname)} {(DQ ($ VSub_DollarName '$BATS_LIBEXEC'))})]
              )
          )
        )
      }
    )
    (C {(export)} 
      {(Lit_VarLike 'BATS_CWD=') 
        (DQ 
          (command_sub
            left_token: <Left_DollarParen '$('>
            command_list: (command.CommandList children:[(C {(abs_dirname)} {(.)})])
          )
        )
      }
    )
    (C {(export)} 
      {(Lit_VarLike 'PATH=') 
        (DQ ($ VSub_DollarName '$BATS_LIBEXEC') (':') ($ VSub_DollarName '$PATH'))
      }
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:options)
          op: Equal
          rhs: {(sh_array_literal left:<Op_LParen '('>)}
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:arguments)
          op: Equal
          rhs: {(sh_array_literal left:<Op_LParen '('>)}
        )
      ]
    )
    (command.ForEach
      iter_name: arg
      iter_words: [{(DQ ($ VSub_At '$@'))}]
      do_arg_iter: F
      body: 
        (command.DoGroup
          children: [
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (command.Sentence
                      child: 
                        (C {(Lit_LBracket '[')} 
                          {
                            (DQ 
                              (braced_var_sub
                                token: <VSub_Name arg>
                                suffix_op: 
                                  (suffix_op.Slice
                                    begin: (arith_expr.ArithWord w:{(Lit_Digits 0)})
                                    length: (arith_expr.ArithWord w:{(Lit_Digits 1)})
                                  )
                              )
                            )
                          } {(Lit_Equals '=')} {(DQ (-))} {(Lit_RBracket ']')}
                        )
                      terminator: <Op_Semi ';'>
                    )
                  ]
                  action: [
                    (command.If
                      arms: [
                        (if_arm
                          cond: [
                            (command.Sentence
                              child: 
                                (C {(Lit_LBracket '[')} 
                                  {
                                    (DQ 
                                      (braced_var_sub
                                        token: <VSub_Name arg>
                                        suffix_op: 
                                          (suffix_op.Slice
                                            begin: (arith_expr.ArithWord w:{(Lit_Digits 1)})
                                            length: (arith_expr.ArithWord w:{(Lit_Digits 1)})
                                          )
                                      )
                                    )
                                  } {(Lit_Equals '=')} {(DQ (-))} {(Lit_RBracket ']')}
                                )
                              terminator: <Op_Semi ';'>
                            )
                          ]
                          action: [
                            (command.ShAssignment
                              pairs: [
                                (assign_pair
                                  lhs: 
                                    (sh_lhs_expr.IndexedName
                                      name: options
                                      index: 
                                        (arith_expr.ArithWord
                                          w: 
                                            {
                                              (braced_var_sub
                                                token: <VSub_Name options>
                                                prefix_op: VSub_Pound
                                                bracket_op: (bracket_op.WholeArray op_id:Arith_Star)
                                              )
                                            }
                                        )
                                    )
                                  op: Equal
                                  rhs: 
                                    {
                                      (DQ 
                                        (braced_var_sub
                                          token: <VSub_Name arg>
                                          suffix_op: 
                                            (suffix_op.Slice
                                              begin: (arith_expr.ArithWord w:{(Lit_Digits 2)})
                                            )
                                        )
                                      )
                                    }
                                )
                              ]
                            )
                          ]
                        )
                      ]
                      else_action: [
                        (command.ShAssignment
                          pairs: [(assign_pair lhs:(sh_lhs_expr.Name name:index) op:Equal rhs:{(1)})]
                        )
                        (command.WhileUntil
                          keyword: <KW_While while>
                          cond: [
                            (command.Sentence
                              child: 
                                (command.ShAssignment
                                  pairs: [
                                    (assign_pair
                                      lhs: (sh_lhs_expr.Name name:option)
                                      op: Equal
                                      rhs: 
                                        {
                                          (DQ 
                                            (braced_var_sub
                                              token: <VSub_Name arg>
                                              suffix_op: 
                                                (suffix_op.Slice
                                                  begin: 
                                                    (arith_expr.ArithWord
                                                      w: {($ VSub_DollarName '$index')}
                                                    )
                                                  length: (arith_expr.ArithWord w:{(Lit_Digits 1)})
                                                )
                                            )
                                          )
                                        }
                                    )
                                  ]
                                )
                              terminator: <Op_Semi ';'>
                            )
                          ]
                          body: 
                            (command.DoGroup
                              children: [
                                (command.AndOr
                                  ops: [Op_DPipe]
                                  children: [
                                    (C {(Lit_LBracket '[')} {(-n)} {(DQ ($ VSub_DollarName '$option'))} 
                                      {(Lit_RBracket ']')}
                                    )
                                    (command.ControlFlow
                                      token: <ControlFlow_Break break>
                                    )
                                  ]
                                )
                                (command.ShAssignment
                                  pairs: [
                                    (assign_pair
                                      lhs: 
                                        (sh_lhs_expr.IndexedName
                                          name: options
                                          index: 
                                            (arith_expr.ArithWord
                                              w: 
                                                {
                                                  (braced_var_sub
                                                    token: <VSub_Name options>
                                                    prefix_op: VSub_Pound
                                                    bracket_op: 
                                                      (bracket_op.WholeArray
                                                        op_id: Arith_Star
                                                      )
                                                  )
                                                }
                                            )
                                        )
                                      op: Equal
                                      rhs: {(DQ ($ VSub_DollarName '$option'))}
                                    )
                                  ]
                                )
                                (C {(let)} {(Lit_VarLike 'index+=') (1)})
                              ]
                            )
                        )
                      ]
                    )
                  ]
                )
              ]
              else_action: [
                (command.ShAssignment
                  pairs: [
                    (assign_pair
                      lhs: 
                        (sh_lhs_expr.IndexedName
                          name: arguments
                          index: 
                            (arith_expr.ArithWord
                              w: 
                                {
                                  (braced_var_sub
                                    token: <VSub_Name arguments>
                                    prefix_op: VSub_Pound
                                    bracket_op: (bracket_op.WholeArray op_id:Arith_Star)
                                  )
                                }
                            )
                        )
                      op: Equal
                      rhs: {(DQ ($ VSub_DollarName '$arg'))}
                    )
                  ]
                )
              ]
            )
          ]
        )
    )
    (C {(unset)} {(count_flag)} {(pretty)})
    (command.AndOr
      ops: [Op_DAmp Op_DAmp]
      children: [
        (C {(Lit_LBracket '[')} {(-t)} {(0)} {(Lit_RBracket ']')})
        (C {(Lit_LBracket '[')} {(-t)} {(1)} {(Lit_RBracket ']')})
        (command.ShAssignment
          pairs: [(assign_pair lhs:(sh_lhs_expr.Name name:pretty) op:Equal rhs:{(DQ (1))})]
        )
      ]
    )
    (command.AndOr
      ops: [Op_DAmp]
      children: [
        (C {(Lit_LBracket '[')} {(-n)} {(DQ ($ VSub_DollarName '$CI'))} {(Lit_RBracket ']')})
        (command.ShAssignment
          pairs: [(assign_pair lhs:(sh_lhs_expr.Name name:pretty) op:Equal rhs:{(DQ )})]
        )
      ]
    )
    (command.ForEach
      iter_name: option
      iter_words: [
        {
          (DQ 
            (braced_var_sub
              token: <VSub_Name options>
              bracket_op: (bracket_op.WholeArray op_id:Lit_At)
            )
          )
        }
      ]
      do_arg_iter: F
      body: 
        (command.DoGroup
          children: [
            (command.Case
              to_match: {(DQ ($ VSub_DollarName '$option'))}
              arms: [
                (case_arm
                  pat_list: [{(DQ (h))} {(DQ (help))}]
                  action: [
                    (C {(help)})
                    (command.ControlFlow
                      token: <ControlFlow_Exit exit>
                      arg_word: {(0)}
                    )
                  ]
                )
                (case_arm
                  pat_list: [{(DQ (v))} {(DQ (version))}]
                  action: [
                    (C {(version)})
                    (command.ControlFlow
                      token: <ControlFlow_Exit exit>
                      arg_word: {(0)}
                    )
                  ]
                )
                (case_arm
                  pat_list: [{(DQ (c))} {(DQ (count))}]
                  action: [
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:count_flag)
                          op: Equal
                          rhs: {(DQ (-c))}
                        )
                      ]
                    )
                  ]
                )
                (case_arm
                  pat_list: [{(DQ (t))} {(DQ (tap))}]
                  action: [
                    (command.ShAssignment
                      pairs: [(assign_pair lhs:(sh_lhs_expr.Name name:pretty) op:Equal rhs:{(DQ )})]
                    )
                  ]
                )
                (case_arm
                  pat_list: [{(DQ (p))} {(DQ (pretty))}]
                  action: [
                    (command.ShAssignment
                      pairs: [(assign_pair lhs:(sh_lhs_expr.Name name:pretty) op:Equal rhs:{(DQ (1))})]
                    )
                  ]
                )
                (case_arm
                  pat_list: [{(Lit_Star '*')}]
                  action: [
                    (command.Simple
                      words: [{(usage)}]
                      redirects: [(redir.Redir op:<Redir_GreatAnd '>&'> fd:16777215 arg_word:{(2)})]
                    )
                    (command.ControlFlow
                      token: <ControlFlow_Exit exit>
                      arg_word: {(1)}
                    )
                  ]
                )
              ]
            )
          ]
        )
    )
    (command.If
      arms: [
        (if_arm
          cond: [
            (command.Sentence
              child: 
                (C {(Lit_LBracket '[')} 
                  {
                    (DQ 
                      (braced_var_sub
                        token: <VSub_Name arguments>
                        prefix_op: VSub_Pound
                        bracket_op: (bracket_op.WholeArray op_id:Lit_At)
                      )
                    )
                  } {(-eq)} {(0)} {(Lit_RBracket ']')}
                )
              terminator: <Op_Semi ';'>
            )
          ]
          action: [
            (command.Simple
              words: [{(usage)}]
              redirects: [(redir.Redir op:<Redir_GreatAnd '>&'> fd:16777215 arg_word:{(2)})]
            )
            (command.ControlFlow token:<ControlFlow_Exit exit> arg_word:{(1)})
          ]
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:filenames)
          op: Equal
          rhs: {(sh_array_literal left:<Op_LParen '('>)}
        )
      ]
    )
    (command.ForEach
      iter_name: filename
      iter_words: [
        {
          (DQ 
            (braced_var_sub
              token: <VSub_Name arguments>
              bracket_op: (bracket_op.WholeArray op_id:Lit_At)
            )
          )
        }
      ]
      do_arg_iter: F
      body: 
        (command.DoGroup
          children: [
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (command.Sentence
                      child: 
                        (C {(Lit_LBracket '[')} {(-d)} {(DQ ($ VSub_DollarName '$filename'))} 
                          {(Lit_RBracket ']')}
                        )
                      terminator: <Op_Semi ';'>
                    )
                  ]
                  action: [
                    (C {(shopt)} {(-s)} {(nullglob)})
                    (command.ForEach
                      iter_name: suite_filename
                      iter_words: [
                        {
                          (DQ 
                            (command_sub
                              left_token: <Left_DollarParen '$('>
                              command_list: 
                                (command.CommandList
                                  children: [(C {(expand_path)} {(DQ ($ VSub_DollarName '$filename'))})]
                                )
                            )
                          ) (/) (Lit_Star '*') (.bats)
                        }
                      ]
                      do_arg_iter: F
                      body: 
                        (command.DoGroup
                          children: [
                            (command.ShAssignment
                              pairs: [
                                (assign_pair
                                  lhs: 
                                    (sh_lhs_expr.IndexedName
                                      name: filenames
                                      index: 
                                        (arith_expr.ArithWord
                                          w: 
                                            {
                                              (DQ 
                                                (braced_var_sub
                                                  token: <VSub_Name filenames>
                                                  prefix_op: VSub_Pound
                                                  bracket_op: (bracket_op.WholeArray op_id:Lit_At)
                                                )
                                              )
                                            }
                                        )
                                    )
                                  op: Equal
                                  rhs: {(DQ ($ VSub_DollarName '$suite_filename'))}
                                )
                              ]
                            )
                          ]
                        )
                    )
                    (C {(shopt)} {(-u)} {(nullglob)})
                  ]
                )
              ]
              else_action: [
                (command.ShAssignment
                  pairs: [
                    (assign_pair
                      lhs: 
                        (sh_lhs_expr.IndexedName
                          name: filenames
                          index: 
                            (arith_expr.ArithWord
                              w: 
                                {
                                  (DQ 
                                    (braced_var_sub
                                      token: <VSub_Name filenames>
                                      prefix_op: VSub_Pound
                                      bracket_op: (bracket_op.WholeArray op_id:Lit_At)
                                    )
                                  )
                                }
                            )
                        )
                      op: Equal
                      rhs: 
                        {
                          (DQ 
                            (command_sub
                              left_token: <Left_DollarParen '$('>
                              command_list: 
                                (command.CommandList
                                  children: [(C {(expand_path)} {(DQ ($ VSub_DollarName '$filename'))})]
                                )
                            )
                          )
                        }
                    )
                  ]
                )
              ]
            )
          ]
        )
    )
    (command.If
      arms: [
        (if_arm
          cond: [
            (command.Sentence
              child: 
                (C {(Lit_LBracket '[')} 
                  {
                    (DQ 
                      (braced_var_sub
                        token: <VSub_Name filenames>
                        prefix_op: VSub_Pound
                        bracket_op: (bracket_op.WholeArray op_id:Lit_At)
                      )
                    )
                  } {(-eq)} {(1)} {(Lit_RBracket ']')}
                )
              terminator: <Op_Semi ';'>
            )
          ]
          action: [
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:command)
                  op: Equal
                  rhs: {(DQ (bats-exec-test))}
                )
              ]
            )
          ]
        )
      ]
      else_action: [
        (command.ShAssignment
          pairs: [
            (assign_pair
              lhs: (sh_lhs_expr.Name name:command)
              op: Equal
              rhs: {(DQ (bats-exec-suite))}
            )
          ]
        )
      ]
    )
    (command.If
      arms: [
        (if_arm
          cond: [
            (command.Sentence
              child: 
                (C {(Lit_LBracket '[')} {(-n)} {(DQ ($ VSub_DollarName '$pretty'))} {(Lit_RBracket ']')})
              terminator: <Op_Semi ';'>
            )
          ]
          action: [
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:extended_syntax_flag)
                  op: Equal
                  rhs: {(DQ (-x))}
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:formatter)
                  op: Equal
                  rhs: {(DQ (bats-format-tap-stream))}
                )
              ]
            )
          ]
        )
      ]
      else_action: [
        (command.ShAssignment
          pairs: [(assign_pair lhs:(sh_lhs_expr.Name name:extended_syntax_flag) op:Equal rhs:{(DQ )})]
        )
        (command.ShAssignment
          pairs: [(assign_pair lhs:(sh_lhs_expr.Name name:formatter) op:Equal rhs:{(DQ (cat))})]
        )
      ]
    )
    (C {(KW_Set set)} {(-o)} {(pipefail)} {(execfail)})
    (command.Pipeline
      children: [
        (C {(exec)} {(DQ ($ VSub_DollarName '$command'))} {($ VSub_DollarName '$count_flag')} 
          {($ VSub_DollarName '$extended_syntax_flag')} {(DQ (braced_var_sub token:<VSub_Name filenames> bracket_op:(bracket_op.WholeArray op_id:Lit_At)))}
        )
        (C {(DQ ($ VSub_DollarName '$formatter'))})
      ]
      negated: F
    )
  ]
)