(command.CommandList
  children: [
    (command.AndOr
      children: [
        (command.DBracket
          left: <Id.KW_DLeftBracket '[['>
          expr: 
            (bool_expr.Binary
              op_id: Id.BoolBinary_GlobDEqual
              left: {($ Id.VSub_DollarName OSTYPE)}
              right: {<Id.Lit_Other '*'> <freebsd> <Id.Lit_Other '*'>}
            )
          right: <Id.Lit_DRightBracket ']]'>
          redirects: []
        )
        (command.ControlFlow keyword:<Id.ControlFlow_Return return> arg_word:{<1>})
      ]
      ops: [<Id.Op_DPipe _>]
    )
    (command.AndOr
      children: [
        (command.ShFunction
          name_tok: <_pkg_delete>
          name: _pkg_delete
          body: 
            (BraceGroup
              left: <Id.Lit_LBrace '{'>
              children: [
                (command.Simple
                  blame_tok: <local>
                  more_env: []
                  words: [{<local>} {<cur>} {<prev>} {<words>} {<cword>}]
                  redirects: []
                  do_fork: T
                )
                (command.AndOr
                  children: [
                    (command.Simple
                      blame_tok: <_init_completion>
                      more_env: []
                      words: [{<_init_completion>}]
                      redirects: []
                      do_fork: T
                    )
                    (command.ControlFlow keyword:<Id.ControlFlow_Return return>)
                  ]
                  ops: [<Id.Op_DPipe _>]
                )
                (command.Simple
                  blame_tok: <local>
                  more_env: []
                  words: [
                    {<local>}
                    {<Id.Lit_VarLike 'pkgdir='> 
                      (BracedVarSub
                        left: <Id.Left_DollarBrace '${'>
                        token: <Id.VSub_Name PKG_DBDIR>
                        var_name: PKG_DBDIR
                        suffix_op: 
                          (suffix_op.Unary
                            op: <Id.VTest_ColonHyphen _>
                            arg_word: 
                              {<Id.Lit_Slash '/'> <var> <Id.Lit_Slash '/'> <db> <Id.Lit_Slash '/'> <pkg>}
                          )
                        right: <Id.Right_DollarBrace '}'>
                      ) <'/'>
                    }
                  ]
                  redirects: []
                  do_fork: T
                )
                (command.AndOr
                  children: [
                    (command.DBracket
                      left: <Id.KW_DLeftBracket '[['>
                      expr: 
                        (bool_expr.LogicalOr
                          left: 
                            (bool_expr.Binary
                              op_id: Id.BoolBinary_GlobDEqual
                              left: {(DQ ($ Id.VSub_DollarName prev))}
                              right: {<Id.BoolUnary_o -o>}
                            )
                          right: 
                            (bool_expr.LogicalOr
                              left: 
                                (bool_expr.Binary
                                  op_id: Id.BoolBinary_GlobDEqual
                                  left: {(DQ ($ Id.VSub_DollarName prev))}
                                  right: {<Id.BoolUnary_p -p>}
                                )
                              right: 
                                (bool_expr.Binary
                                  op_id: Id.BoolBinary_GlobDEqual
                                  left: {(DQ ($ Id.VSub_DollarName prev))}
                                  right: {<-W>}
                                )
                            )
                        )
                      right: <Id.Lit_DRightBracket ']]'>
                      redirects: []
                    )
                    (command.ControlFlow
                      keyword: <Id.ControlFlow_Return return>
                      arg_word: {<0>}
                    )
                  ]
                  ops: [<Id.Op_DAmp _>]
                )
                (command.ShAssignment
                  left: <Id.Lit_VarLike 'COMPREPLY='>
                  pairs: [
                    (AssignPair
                      left: <Id.Lit_VarLike 'COMPREPLY='>
                      lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'COMPREPLY='> name:COMPREPLY)
                      op: assign_op.Equal
                      rhs: 
                        {
                          (ShArrayLiteral
                            left: <Id.Op_LParen _>
                            words: [
                              {
                                (CommandSub
                                  left_token: <Id.Left_DollarParen '$('>
                                  child: 
                                    (command.Simple
                                      blame_tok: <compgen>
                                      more_env: []
                                      words: [
                                        {<compgen>}
                                        {<-d>}
                                        {<-->}
                                        {
                                          (DQ ($ Id.VSub_DollarName pkgdir) ($ Id.VSub_DollarName cur))
                                        }
                                      ]
                                      redirects: []
                                      do_fork: T
                                    )
                                  right: <Id.Eof_RParen _>
                                )
                              }
                            ]
                            right: <Id.Right_ShArrayLiteral _>
                          )
                        }
                    )
                  ]
                  redirects: []
                )
                (command.ShAssignment
                  left: <Id.Lit_VarLike 'COMPREPLY='>
                  pairs: [
                    (AssignPair
                      left: <Id.Lit_VarLike 'COMPREPLY='>
                      lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'COMPREPLY='> name:COMPREPLY)
                      op: assign_op.Equal
                      rhs: 
                        {
                          (ShArrayLiteral
                            left: <Id.Op_LParen _>
                            words: [
                              {
                                (BracedVarSub
                                  left: <Id.Left_DollarBrace '${'>
                                  token: <Id.VSub_Name COMPREPLY>
                                  var_name: COMPREPLY
                                  bracket_op: (bracket_op.WholeArray op_id:Id.Lit_At)
                                  suffix_op: 
                                    (suffix_op.Unary
                                      op: <Id.VOp1_Pound '#'>
                                      arg_word: {($ Id.VSub_DollarName pkgdir)}
                                    )
                                  right: <Id.Right_DollarBrace '}'>
                                )
                              }
                            ]
                            right: <Id.Right_ShArrayLiteral _>
                          )
                        }
                    )
                  ]
                  redirects: []
                )
                (command.ControlFlow
                  keyword: <Id.ControlFlow_Return return>
                  arg_word: {<0>}
                )
              ]
              redirects: []
              right: <Id.Lit_RBrace '}'>
            )
        )
        (command.Simple
          blame_tok: <complete>
          more_env: []
          words: [
            {<complete>}
            {<-F>}
            {<_pkg_delete>}
            {<-o>}
            {<dirnames>}
            {<pkg_delete>}
            {<pkg_info>}
            {<pkg_deinstall>}
          ]
          redirects: []
          do_fork: T
        )
      ]
      ops: [<Id.Op_DAmp _>]
    )
  ]
)