proc plugin_list_command { var plugins_path = '' plugins_path := $[get_plugin_path] if ls $plugins_path &> /dev/null; { for plugin_path in [$plugins_path/*] { basename $plugin_path } } else { echo 'Oohes nooes ~! No plugins installed' } } (CommandList children: [ (FuncDef name: plugin_list_command body: (BraceGroup children: [ (Assignment keyword: Assign_Local pairs: [(assign_pair lhs:(LhsName name:plugins_path) op:Equal spids:[9])] spids: [7] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:plugins_path) op: Equal rhs: { (CommandSubPart command_list: (CommandList children:[(C {(get_plugin_path)})]) left_token: spids: [13 15] ) } spids: [12] ) ] spids: [12] ) (If arms: [ (if_arm cond: [ (Sentence child: (C {(ls)} {(DQ ($ VSub_Name "$plugins_path"))}) terminator: ) (Sentence child: (SimpleCommand redirects: [ (Redir op_id: Redir_Great fd: -1 arg_word: {(/dev/null)} spids: [28] ) ] ) terminator: ) ] action: [ (ForEach iter_name: plugin_path iter_words: [{($ VSub_Name "$plugins_path") (/) (Lit_Other "*")}] do_arg_iter: False body: (DoGroup children: [(C {(basename)} {(DQ ($ VSub_Name "$plugin_path"))})] spids: [48 58] ) spids: [41 46] ) ] spids: [-1 33] ) ] else_action: [(C {(echo)} {(SQ <"Oohes nooes ~! No plugins installed">)})] spids: [61 71] ) ] spids: [4] ) spids: [0 3] ) ] )