(command.AndOr
  ops: [Id.Op_DAmp]
  children: [
    (command.ShFunction
      name: _cpan2dist
      body: 
        (command.BraceGroup
          children: [
            (C {(local)} {(cur)} {(prev)} {(words)} {(cword)})
            (command.AndOr
              ops: [Id.Op_DPipe]
              children: [
                (C {(_init_completion)})
                (command.ControlFlow
                  token: (Token id:Id.ControlFlow_Return val:return span_id:26)
                )
              ]
            )
            (command.Case
              to_match: {($ Id.VSub_DollarName '$prev')}
              arms: [
                (case_arm
                  pat_list: [{(--format)}]
                  action: [
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:COMPREPLY)
                          op: assign_op.Equal
                          rhs: 
                            {
                              (sh_array_literal
                                left: (Token id:Id.Op_LParen val:'(' span_id:46)
                                words: [
                                  {
                                    (command_sub
                                      left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:48)
                                      command_list: 
                                        (command.CommandList
                                          children: [
                                            (C {(compgen)} {(-W)} 
                                              {
                                                (SQ 
                                                  (Token
                                                    id: Id.Lit_Chars
                                                    val: '$(perl -MCPANPLUS::Dist -e \\\n'
                                                    span_id: 55
                                                  ) 
                                                  (Token
                                                    id: Id.Lit_Chars
                                                    val: 
'                "print map { \\"\\$_\\n\\" } CPANPLUS::Dist->dist_types")'
                                                    span_id: 56
                                                  )
                                                )
                                              } {(--)} {(DQ ($ Id.VSub_DollarName '$cur'))}
                                            )
                                          ]
                                        )
                                    )
                                  }
                                ]
                              )
                            }
                          spids: [45]
                        )
                      ]
                    )
                    (command.ControlFlow
                      token: (Token id:Id.ControlFlow_Return val:return span_id:72)
                      arg_word: {(0)}
                    )
                  ]
                  spids: [37 38 77 -1]
                )
                (case_arm
                  pat_list: [{(--banlist)} {(--ignorelist)} {(--modulelist)} {(--logfile)}]
                  action: [
                    (C {(_filedir)})
                    (command.ControlFlow
                      token: (Token id:Id.ControlFlow_Return val:return span_id:93)
                      arg_word: {(0)}
                    )
                  ]
                  spids: [80 87 98 -1]
                )
              ]
            )
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (command.Sentence
                      child: 
                        (command.DBracket
                          expr: 
                            (bool_expr.Binary
                              op_id: Id.BoolBinary_GlobDEqual
                              left: {(DQ ($ Id.VSub_DollarName '$cur'))}
                              right: {(-) (Id.Lit_Other '*')}
                            )
                        )
                      terminator: (Token id:Id.Op_Semi val:';' span_id:119)
                    )
                  ]
                  action: [
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:COMPREPLY)
                          op: assign_op.Equal
                          rhs: 
                            {
                              (sh_array_literal
                                left: (Token id:Id.Op_LParen val:'(' span_id:125)
                                words: [
                                  {
                                    (command_sub
                                      left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:127)
                                      command_list: 
                                        (command.CommandList
                                          children: [
                                            (C {(compgen)} {(-W)} 
                                              {
                                                (SQ 
                                                  (Token
                                                    id: Id.Lit_Chars
                                                    val: '$( _parse_help "$1" )'
                                                    span_id: 134
                                                  )
                                                )
                                              } {(--)} {(DQ ($ Id.VSub_DollarName '$cur'))}
                                            )
                                          ]
                                        )
                                    )
                                  }
                                ]
                              )
                            }
                          spids: [124]
                        )
                      ]
                    )
                  ]
                  spids: [105 121]
                )
              ]
              else_action: [
                (C {(local)} 
                  {(Id.Lit_VarLike 'cpandirs=') 
                    (sh_array_literal
                      left: (Token id:Id.Op_LParen val:'(' span_id:154)
                      words: [
                        {(DQ ($ Id.VSub_DollarName '$HOME') (/.cpanplus/))}
                        {(DQ ($ Id.VSub_DollarName '$HOME') (/.cpan/source/modules/))}
                      ]
                    )
                  }
                )
                (C {(local)} {(packagelist)})
                (command.ForEach
                  iter_name: dir
                  iter_words: [
                    {
                      (braced_var_sub
                        token: (Token id:Id.VSub_Name val:cpandirs span_id:181)
                        bracket_op: (bracket_op.WholeArray op_id:Id.Lit_At)
                      )
                    }
                  ]
                  do_arg_iter: F
                  body: 
                    (command.DoGroup
                      children: [
                        (command.AndOr
                          ops: [Id.Op_DAmp]
                          children: [
                            (command.DBracket
                              expr: 
                                (bool_expr.LogicalAnd
                                  left: 
                                    (bool_expr.Unary
                                      op_id: Id.BoolUnary_d
                                      child: {(DQ ($ Id.VSub_DollarName '$dir'))}
                                    )
                                  right: 
                                    (bool_expr.Unary
                                      op_id: Id.BoolUnary_r
                                      child: 
                                        {
                                          (DQ ($ Id.VSub_DollarName '$dir') 
                                            (/02packages.details.txt.gz)
                                          )
                                        }
                                    )
                                )
                            )
                            (command.ShAssignment
                              pairs: [
                                (assign_pair
                                  lhs: (sh_lhs_expr.Name name:packagelist)
                                  op: assign_op.Equal
                                  rhs: 
                                    {(DQ ($ Id.VSub_DollarName '$dir') (/02packages.details.txt.gz))}
                                  spids: [214]
                                )
                              ]
                            )
                          ]
                        )
                      ]
                    )
                )
                (command.AndOr
                  ops: [Id.Op_DAmp]
                  children: [
                    (command.DBracket
                      expr: (bool_expr.WordTest w:{($ Id.VSub_DollarName '$packagelist')})
                    )
                    (command.ShAssignment
                      pairs: [
                        (assign_pair
                          lhs: (sh_lhs_expr.Name name:COMPREPLY)
                          op: assign_op.Equal
                          rhs: 
                            {
                              (sh_array_literal
                                left: (Token id:Id.Op_LParen val:'(' span_id:233)
                                words: [
                                  {
                                    (command_sub
                                      left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:235)
                                      command_list: 
                                        (command.CommandList
                                          children: [
                                            (command.Pipeline
                                              children: [
                                                (command.Simple
                                                  words: [
                                                    {(zgrep)}
                                                    {
                                                      (DQ ('^') 
                                                        (braced_var_sub
                                                          token: 
                                                            (Token
                                                              id: Id.VSub_Name
                                                              val: cur
                                                              span_id: 242
                                                            )
                                                          suffix_op: 
                                                            (suffix_op.PatSub
                                                              pat: {(-)}
                                                              replace: {('::')}
                                                              replace_mode: Id.Lit_Slash
                                                            )
                                                        )
                                                      )
                                                    }
                                                    {($ Id.VSub_DollarName '$packagelist')}
                                                  ]
                                                  redirects: [
                                                    (redir.Redir
                                                      op: 
                                                        (Token
                                                          id: Id.Redir_Great
                                                          val: '2>'
                                                          span_id: 255
                                                        )
                                                      fd: 2
                                                      arg_word: {(/dev/null)}
                                                    )
                                                  ]
                                                )
                                                (C {(awk)} 
                                                  {
                                                    (SQ 
                                                      (Token
                                                        id: Id.Lit_Chars
                                                        val: '{print $1}'
                                                        span_id: 263
                                                      )
                                                    )
                                                  }
                                                )
                                                (C {(sed)} {(-e)} 
                                                  {
                                                    (SQ 
                                                      (Token
                                                        id: Id.Lit_Chars
                                                        val: 's/::/-/g'
                                                        span_id: 273
                                                      )
                                                    )
                                                  }
                                                )
                                              ]
                                              negated: F
                                            )
                                          ]
                                        )
                                    )
                                  }
                                ]
                              )
                            }
                          spids: [232]
                        )
                      ]
                    )
                  ]
                )
              ]
            )
          ]
        )
    )
    (C {(complete)} {(-F)} {(_cpan2dist)} {(-o)} {(default)} {(cpan2dist)})
  ]
)