(command.CommandList
  children: [
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:BALLS_LIB)
          op: assign_op.Equal
          rhs: 
            {
              (command_sub
                left_token: <Id.Left_DollarParen '$('>
                child: (C {<dirname>} {($ Id.VSub_Number '$0')})
              ) <'/../lib'>
            }
          spids: [3]
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:BALLS_LIB)
          op: assign_op.Equal
          rhs: 
            {
              (command_sub
                left_token: <Id.Left_DollarParen '$('>
                child: (C {<readlink>} {<-f>} {(DQ ($ Id.VSub_DollarName '$BALLS_LIB'))})
              )
            }
          spids: [11]
        )
      ]
    )
    (command.CommandList
      children: [
        (command.Sentence
          child: 
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:mode)
                  op: assign_op.Equal
                  rhs: {($ Id.VSub_Number '$1')}
                  spids: [26]
                )
              ]
            )
          terminator: <Id.Op_Semi _>
        )
        (C {<shift>})
      ]
    )
    (command.WhileUntil
      keyword: <Id.KW_While while>
      cond: 
        (condition.Shell
          commands: [
            (command.Sentence
              child: (C {<getopts>} {(SQ <'e:C:'>)} {<opt>})
              terminator: <Id.Op_Semi _>
            )
          ]
        )
      body: 
        (command.DoGroup
          children: [
            (command.Case
              to_match: {($ Id.VSub_DollarName '$opt')}
              arms: [
                (case_arm
                  pat_list: [{<C>}]
                  action: [
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:BALLS_CONF)
                          op: assign_op.Equal
                          rhs: {($ Id.VSub_DollarName '$OPTARG')}
                          spids: [58]
                        )
                      ]
                    )
                  ]
                  spids: [54 55 62 -1]
                )
                (case_arm
                  pat_list: [{<e>}]
                  action: [
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:BALLS_ENV)
                          op: assign_op.Equal
                          rhs: {($ Id.VSub_DollarName '$OPTARG')}
                          spids: [69]
                        )
                      ]
                    )
                  ]
                  spids: [65 66 73 -1]
                )
                (case_arm
                  pat_list: [{(word_part.EscapedLiteral token:<Id.Lit_EscapedChar '\\?'>)}]
                  action: [
                    (C {<echo>} {(DQ <'Usage: '> ($ Id.VSub_Number '$0') <' <mode> [options]'>)})
                    (C {<echo>})
                    (C {<echo>} {(SQ <'Options:'>)})
                    (C {<echo>} {(SQ <'  -e <env>   the server environment, BALLS_ENV'>)})
                    (C {<echo>} {(SQ <'             default: development'>)})
                    (C {<echo>})
                    (C {<echo>} {(SQ <'  -C <path>  path to the balls conf file, BALLS_CONF'>)})
                    (C {<echo>} {(SQ <'             default: ./config/$BALLS_ENV.sh'>)})
                  ]
                  spids: [76 77 130 -1]
                )
              ]
            )
          ]
        )
    )
    (command.AndOr
      ops: [Id.Op_DAmp]
      children: [
        (command.DBracket
          expr: (bool_expr.Unary op_id:Id.BoolUnary_z child:{(DQ ($ Id.VSub_DollarName '$BALLS_ENV'))})
        )
        (command.ShAssignment
          pairs: [
            (assign_pair
              lhs: (sh_lhs_expr.Name name:BALLS_ENV)
              op: assign_op.Equal
              rhs: {<development>}
              spids: [150]
            )
          ]
        )
      ]
    )
    (command.AndOr
      ops: [Id.Op_DAmp]
      children: [
        (command.DBracket
          expr: (bool_expr.Unary op_id:Id.BoolUnary_z child:{(DQ ($ Id.VSub_DollarName '$BALLS_CONF'))})
        )
        (command.ShAssignment
          pairs: [
            (assign_pair
              lhs: (sh_lhs_expr.Name name:BALLS_CONF)
              op: assign_op.Equal
              rhs: {<'./config/'> ($ Id.VSub_DollarName '$BALLS_ENV') <.sh>}
              spids: [165]
            )
          ]
        )
      ]
    )
    (C {<.>} {(DQ ($ Id.VSub_DollarName '$BALLS_CONF'))})
    (C {<.>} {($ Id.VSub_DollarName '$BALLS_LIB') <'/balls.sh'>})
    (command.Case
      to_match: {($ Id.VSub_DollarName '$mode')}
      arms: [
        (case_arm
          pat_list: [{<server>}]
          action: [(C {<balls> <Id.Lit_Colon ':'> <Id.Lit_Colon ':'> ($ Id.VSub_DollarName '$mode')})]
          spids: [190 191 200 -1]
        )
        (case_arm
          pat_list: [{<Id.Lit_Star '*'>}]
          action: [(C {<echo>} {(DQ <unknown>)})]
          spids: [203 204 214 -1]
        )
      ]
    )
  ]
)