proc plugin_update_command { if test "$Argc" -ne 1 { display_error "usage: asdf plugin-update { | --all}" exit 1 } var plugin_name = $1 if test $plugin_name = "--all" { for dir in ["$[asdf_dir]"/plugins/*] { echo "Updating $[basename $dir]..." shell {cd $dir && git pull} } } else { var plugin_path = '' plugin_path := $[get_plugin_path $plugin_name] check_if_plugin_exists $plugin_name echo "Updating $plugin_name..." shell {cd $plugin_path && git pull} } } (CommandList children: [ (FuncDef name: plugin_update_command body: (BraceGroup children: [ (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other "[")} {(DQ ($ VSub_Pound "$#"))} {(-ne)} {(1)} {(Lit_Other "]")}) terminator: ) ] action: [ (C {(display_error)} {(DQ ("usage: asdf plugin-update { | --all}"))}) (C {(exit)} {(1)}) ] spids: [-1 22] ) ] spids: [-1 37] ) (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:plugin_name) op: Equal rhs: {($ VSub_Number "$1")} spids: [43] ) ] spids: [41] ) (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other "[")} {(DQ ($ VSub_Name "$plugin_name"))} {(Lit_Other "=")} {(DQ (--all))} {(Lit_Other "]")} ) terminator: ) ] action: [ (ForEach iter_name: dir iter_words: [ { (DQ (CommandSubPart command_list: (CommandList children:[(C {(asdf_dir)})]) left_token: spids: [74 76] ) ) (/plugins/) (Lit_Other "*") } ] do_arg_iter: False body: (DoGroup children: [ (C {(echo)} { (DQ ("Updating ") (CommandSubPart command_list: (CommandList children: [(C {(basename)} {(DQ ($ VSub_Name "$dir"))})] ) left_token: spids: [89 95] ) (...) ) } ) (Subshell child: (AndOr children: [(C {(cd)} {(DQ ($ VSub_Name "$dir"))}) (C {(git)} {(pull)})] op_id: Op_DAmp ) spids: [100 112] ) ] spids: [82 115] ) spids: [72 80] ) ] spids: [-1 64] ) ] else_action: [ (Assignment keyword: Assign_Local pairs: [(assign_pair lhs:(LhsName name:plugin_path) op:Equal spids:[123])] spids: [121] ) (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: spids: [127 133] ) } spids: [126] ) ] spids: [126] ) (C {(check_if_plugin_exists)} {(DQ ($ VSub_Name "$plugin_name"))}) (C {(echo)} {(DQ ("Updating ") ($ VSub_Name "$plugin_name") (...))}) (Subshell child: (AndOr children: [(C {(cd)} {(DQ ($ VSub_Name "$plugin_path"))}) (C {(git)} {(pull)})] op_id: Op_DAmp ) spids: [152 164] ) ] spids: [118 167] ) ] spids: [4] ) spids: [0 3] ) ] )