(CommandList children: [ (AndOr children: [ (C {(_have)} {(pkgrm)}) (AndOr children: [ (FuncDef name: _pkgrm body: (BraceGroup children: [ (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:cur) op: Equal spids: [26] ) (assign_pair lhs: (LhsName name:prev) op: Equal spids: [28] ) (assign_pair lhs: (LhsName name:words) op: Equal spids: [30] ) (assign_pair lhs: (LhsName name:cword) op: Equal spids: [32] ) ] spids: [24] ) (AndOr children: [ (C {(_init_completion)}) (ControlFlow token:<ControlFlow_Return return>) ] op_id: Op_DPipe ) (Sentence child: (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:spool) op: Equal rhs: {(/var/sadm/pkg)} spids: [58] ) ] spids: [56] ) terminator: <Op_Semi ";"> ) (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:i) op: Equal rhs: {($ VSub_Name "$cword")} spids: [65] ) ] spids: [63] ) (Sentence child: (While cond: [ (Sentence child: (DBracket expr: (BoolBinary op_id: BoolBinary_gt left: { (ArithSubPart anode: (UnaryAssign op_id: Node_PostDMinus child: (LhsName name:i) ) spids: [73 77] ) } right: {(0)} ) ) terminator: <Op_Semi ";"> ) ] body: (DoGroup children: [ (Sentence child: (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:i) op: Equal rhs: { (ArithSubPart anode: (ArithBinary op_id: Arith_Minus left: (ArithVarRef name:i) right: (ArithWord w:{(Lit_Digits 1)}) ) spids: [90 95] ) } spids: [89] ) ] spids: [89] ) terminator: <Op_Semi ";"> ) (Sentence child: (Case to_match: { (DQ (BracedVarSub token: <VSub_Name words> bracket_op: (ArrayIndex expr: (ArithWord w:{($ VSub_Name "$i")}) ) spids: [102 107] ) ) } arms: [ (case_arm pat_list: [{(-s)}] action: [ (Sentence child: (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:spool) op: Equal rhs: { (DQ (BracedVarSub token: <VSub_Name words> bracket_op: (ArrayIndex expr: (ArithWord w: { (ArithSubPart anode: (ArithBinary op_id: Arith_Plus left: (ArithVarRef name: i ) right: (ArithWord w: { ( Lit_Digits 1 ) } ) ) spids: [122 127] ) } ) ) spids: [119 129] ) ) } spids: [117] ) ] spids: [117] ) terminator: <Op_Semi ";"> ) (ControlFlow token: <ControlFlow_Break break> ) ] spids: [113 114 137 -1] ) ] spids: [99 110 140] ) terminator: <Op_Semi ";"> ) ] spids: [86 144] ) ) terminator: <Op_Semi ";"> ) (Case to_match: {($ VSub_Name "$prev")} arms: [ (case_arm pat_list: [{(-a)} {(-V)}] action: [(C {(_filedir)})] spids: [156 161 167 -1] ) (case_arm pat_list: [{(-s)} {(-R)}] action: [(C {(_filedir)} {(-d)})] spids: [170 175 183 -1] ) (case_arm pat_list:[{(-Y)}] spids:[186187190-1]) (case_arm pat_list: [{(Lit_Other "*")}] action: [ (If arms: [ (if_arm cond: [ (Sentence child: (DBracket expr: (BoolBinary op_id: BoolBinary_GlobDEqual left: {(${ VSub_Name cur)} right: {(-) (Lit_Other "*")} ) ) terminator: <Op_Semi ";"> ) ] action: [ (Sentence child: (Assignment keyword: Assign_Local pairs: [ (assign_pair lhs: (LhsName name:opts) op: Equal rhs: {(DQ ("-a -A -n -M -R -s -v -V -Y"))} spids: [218] ) ] spids: [216] ) terminator: <Op_Semi ";"> ) (Sentence child: (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:COMPREPLY) op: Equal rhs: { (ArrayLiteralPart words: [ { (CommandSubPart command_list: (CommandList children: [ (C {(compgen)} {(-W)} {(DQ (${ VSub_Name opts))} {(--)} {(${ VSub_Name cur)} ) ] ) left_token: <Left_CommandSub "$("> spids: [227 243] ) } ] ) } spids: [225] ) ] spids: [225] ) terminator: <Op_Semi ";"> ) (Sentence child: (ControlFlow token: <ControlFlow_Return return> arg_word: {(0)} ) terminator: <Op_Semi ";"> ) ] spids: [-1 213] ) ] else_action: [ (Sentence child: (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:COMPREPLY) op: Equal rhs: { (ArrayLiteralPart words: [ { (CommandSubPart command_list: (CommandList children: [ (C {(compgen)} {(-W)} { (DQ (CommandSubPart command_list: (CommandList children: [ (C {(/bin/ls)} {(-1)} {($ VSub_Name "$spool")} ) ] ) left_token: <Left_CommandSub "$("> spids: [265 271] ) ) } {(--)} {(${ VSub_Name cur)} ) ] ) left_token: <Left_CommandSub "$("> spids: [259 279] ) } ] ) } spids: [257] ) ] spids: [257] ) terminator: <Op_Semi ";"> ) (Sentence child: (ControlFlow token:<ControlFlow_Return return> arg_word:{(0)}) terminator: <Op_Semi ";"> ) ] spids: [254 290] ) ] spids: [193 194 293 -1] ) ] spids: [149 153 296] ) ] spids: [21] ) spids: [16 20] ) (C {(complete)} {(-F)} {(_pkgrm)} {(pkgrm)}) ] op_id: Op_DAmp ) ] op_id: Op_DAmp ) ] )