(CommandList
  children: [
    (FuncDef
      name: plugin_current_command
      body: 
        (BraceGroup
          children: [
            (Assignment
              keyword: Assign_Local
              pairs: [
                (assign_pair
                  lhs: (LhsName name:plugin_name)
                  op: Equal
                  rhs: {($ VSub_Number "$1")}
                  spids: [9]
                )
              ]
              spids: [7]
            )
            (C {(check_if_plugin_exists)} {(DQ ($ VSub_Name "$plugin_name"))})
            (Assignment
              keyword: Assign_Local
              pairs: [(assign_pair lhs:(LhsName name:search_path) op:Equal spids:[24])]
              spids: [22]
            )
            (Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (LhsName name:search_path)
                  op: Equal
                  rhs: 
                    {
                      (CommandSubPart
                        command_list: (CommandList children:[(C {(pwd)})])
                        left_token: <Left_CommandSub "$(">
                        spids: [28 30]
                      )
                    }
                  spids: [27]
                )
              ]
              spids: [27]
            )
            (Assignment
              keyword: Assign_Local
              pairs: [(assign_pair lhs:(LhsName name:version_and_path) op:Equal spids:[35])]
              spids: [33]
            )
            (Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (LhsName name:version_and_path)
                  op: Equal
                  rhs: 
                    {
                      (CommandSubPart
                        command_list: 
                          (CommandList
                            children: [
                              (C {(find_version)} {(DQ ($ VSub_Name "$plugin_name"))} 
                                {(DQ ($ VSub_Name "$search_path"))}
                              )
                            ]
                          )
                        left_token: <Left_CommandSub "$(">
                        spids: [39 49]
                      )
                    }
                  spids: [38]
                )
              ]
              spids: [38]
            )
            (Assignment
              keyword: Assign_Local
              pairs: [(assign_pair lhs:(LhsName name:version) op:Equal spids:[54])]
              spids: [52]
            )
            (Sentence
              child: 
                (Assignment
                  keyword: Assign_None
                  pairs: [
                    (assign_pair
                      lhs: (LhsName name:version)
                      op: Equal
                      rhs: 
                        {
                          (CommandSubPart
                            command_list: 
                              (CommandList
                                children: [
                                  (SimpleCommand
                                    words: [{(cut)} {(-d)} {(SQ <"|">)} {(-f)} {(1)}]
                                    redirects: [
                                      (Redir
                                        op_id: Redir_TLess
                                        fd: -1
                                        arg_word: {(DQ ($ VSub_Name "$version_and_path"))}
                                        spids: [71]
                                      )
                                    ]
                                  )
                                ]
                              )
                            left_token: <Left_CommandSub "$(">
                            spids: [58 76]
                          )
                        }
                      spids: [57]
                    )
                  ]
                  spids: [57]
                )
              terminator: <Op_Semi ";">
            )
            (Assignment
              keyword: Assign_Local
              pairs: [(assign_pair lhs:(LhsName name:version_file_path) op:Equal spids:[82])]
              spids: [80]
            )
            (Sentence
              child: 
                (Assignment
                  keyword: Assign_None
                  pairs: [
                    (assign_pair
                      lhs: (LhsName name:version_file_path)
                      op: Equal
                      rhs: 
                        {
                          (CommandSubPart
                            command_list: 
                              (CommandList
                                children: [
                                  (SimpleCommand
                                    words: [{(cut)} {(-d)} {(SQ <"|">)} {(-f)} {(2)}]
                                    redirects: [
                                      (Redir
                                        op_id: Redir_TLess
                                        fd: -1
                                        arg_word: {(DQ ($ VSub_Name "$version_and_path"))}
                                        spids: [99]
                                      )
                                    ]
                                  )
                                ]
                              )
                            left_token: <Left_CommandSub "$(">
                            spids: [86 104]
                          )
                        }
                      spids: [85]
                    )
                  ]
                  spids: [85]
                )
              terminator: <Op_Semi ";">
            )
            (C {(check_if_version_exists)} {(DQ ($ VSub_Name "$plugin_name"))} 
              {(DQ ($ VSub_Name "$version"))}
            )
            (C {(check_for_deprecated_plugin)} {(DQ ($ VSub_Name "$plugin_name"))})
            (If
              arms: [
                (if_arm
                  cond: [
                    (Sentence
                      child: 
                        (C {(Lit_Other "[")} {(-z)} {(DQ ($ VSub_Name "$version"))} {(Lit_Other "]")})
                      terminator: <Op_Semi ";">
                    )
                  ]
                  action: [
                    (C {(echo)} {(DQ ("No version set for ") ($ VSub_Name "$plugin_name"))})
                    (C {(exit)} {(1)})
                  ]
                  spids: [-1 141]
                )
              ]
              else_action: [
                (C {(echo)} 
                  {
                    (DQ ($ VSub_Name "$version") (" (set by ") ($ VSub_Name "$version_file_path") (")"))
                  }
                )
              ]
              spids: [157 170]
            )
          ]
          spids: [4]
        )
      spids: [0 3]
    )
    (FuncDef
      name: current_command
      body: 
        (BraceGroup
          children: [
            (If
              arms: [
                (if_arm
                  cond: [
                    (Sentence
                      child: 
                        (C {(Lit_Other "[")} {($ VSub_Pound "$#")} {(-eq)} {(0)} {(Lit_Other "]")})
                      terminator: <Op_Semi ";">
                    )
                  ]
                  action: [
                    (ForEach
                      iter_name: plugin
                      iter_words: [
                        {
                          (CommandSubPart
                            command_list: (CommandList children:[(C {(plugin_list_command)})])
                            left_token: <Left_CommandSub "$(">
                            spids: [204 206]
                          )
                        }
                      ]
                      do_arg_iter: False
                      body: 
                        (DoGroup
                          children: [
                            (C {(echo)} 
                              {
                                (DQ ($ VSub_Name "$plugin") (" ") 
                                  (CommandSubPart
                                    command_list: 
                                      (CommandList
                                        children: [
                                          (C {(plugin_current_command)} {(DQ ($ VSub_Name "$plugin"))})
                                        ]
                                      )
                                    left_token: <Left_CommandSub "$(">
                                    spids: [217 223]
                                  )
                                )
                              }
                            )
                          ]
                          spids: [209 227]
                        )
                      spids: [203 207]
                    )
                  ]
                  spids: [-1 195]
                )
              ]
              else_action: [
                (Assignment
                  keyword: Assign_Local
                  pairs: [
                    (assign_pair
                      lhs: (LhsName name:plugin)
                      op: Equal
                      rhs: {($ VSub_Number "$1")}
                      spids: [235]
                    )
                  ]
                  spids: [233]
                )
                (C {(plugin_current_command)} {(DQ ($ VSub_Name "$plugin"))})
              ]
              spids: [230 246]
            )
          ]
          spids: [179]
        )
      spids: [175 178]
    )
    (FuncDef
      name: check_for_deprecated_plugin
      body: 
        (BraceGroup
          children: [
            (Assignment
              keyword: Assign_Local
              pairs: [
                (assign_pair
                  lhs: (LhsName name:plugin_name)
                  op: Equal
                  rhs: {($ VSub_Number "$1")}
                  spids: [263]
                )
              ]
              spids: [261]
            )
            (Assignment
              keyword: Assign_Local
              pairs: [(assign_pair lhs:(LhsName name:plugin_path) op:Equal spids:[270])]
              spids: [268]
            )
            (Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (LhsName name:plugin_path)
                  op: Equal
                  rhs: 
                    {
                      (CommandSubPart
                        command_list: 
                          (CommandList
                            children: [(C {(get_plugin_path)} {(DQ ($ VSub_Name "$plugin_name"))})]
                          )
                        left_token: <Left_CommandSub "$(">
                        spids: [274 280]
                      )
                    }
                  spids: [273]
                )
              ]
              spids: [273]
            )
            (Assignment
              keyword: Assign_Local
              pairs: [(assign_pair lhs:(LhsName name:legacy_config) op:Equal spids:[285])]
              spids: [283]
            )
            (Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (LhsName name:legacy_config)
                  op: Equal
                  rhs: 
                    {
                      (CommandSubPart
                        command_list: 
                          (CommandList
                            children: [(C {(get_asdf_config_value)} {(DQ (legacy_version_file))})]
                          )
                        left_token: <Left_CommandSub "$(">
                        spids: [289 295]
                      )
                    }
                  spids: [288]
                )
              ]
              spids: [288]
            )
            (Assignment
              keyword: Assign_Local
              pairs: [
                (assign_pair
                  lhs: (LhsName name:deprecated_script)
                  op: Equal
                  rhs: {(DQ (${ VSub_Name plugin_path) (/bin/get-version-from-legacy-file))}
                  spids: [300]
                )
              ]
              spids: [298]
            )
            (Assignment
              keyword: Assign_Local
              pairs: [
                (assign_pair
                  lhs: (LhsName name:new_script)
                  op: Equal
                  rhs: {(DQ (${ VSub_Name plugin_path) (/bin/list-legacy-filenames))}
                  spids: [311]
                )
              ]
              spids: [309]
            )
            (If
              arms: [
                (if_arm
                  cond: [
                    (Sentence
                      child: 
                        (AndOr
                          children: [
                            (C {(Lit_Other "[")} {(DQ ($ VSub_Name "$legacy_config"))} {(Lit_Other "=")} 
                              {(DQ (yes))} {(Lit_Other "]")}
                            )
                            (AndOr
                              children: [
                                (C {(Lit_Other "[")} {(-f)} {(DQ ($ VSub_Name "$deprecated_script"))} 
                                  {(Lit_Other "]")}
                                )
                                (C {(Lit_Other "[")} {(KW_Bang "!")} {(-f)} 
                                  {(DQ ($ VSub_Name "$new_script"))} {(Lit_Other "]")}
                                )
                              ]
                              op_id: Op_DAmp
                            )
                          ]
                          op_id: Op_DAmp
                        )
                      terminator: <Op_Semi ";">
                    )
                  ]
                  action: [
                    (C {(echo)} 
                      {
                        (DQ ("Heads up! It looks like your ") ($ VSub_Name "$plugin_name") 
                          (" plugin is out of date. You can update it with:")
                        )
                      }
                    )
                    (C {(echo)} {(DQ )})
                    (C {(echo)} {(DQ ("  asdf plugin-update ") ($ VSub_Name "$plugin_name"))})
                    (C {(echo)} {(DQ )})
                  ]
                  spids: [-1 364]
                )
              ]
              spids: [-1 396]
            )
          ]
          spids: [258]
        )
      spids: [254 257]
    )
  ]
)