(command.AndOr ops: [Id.Op_DAmp] children: [ (command.ShFunction name: _update_rc_d 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:32) ) ] ) (C {(local)} {(sysvdir)} {(services)} {(options)} {(valid_options)}) (command.AndOr ops: [Id.Op_DAmp Id.Op_DPipe] children: [ (command.DBracket expr: (bool_expr.Unary op_id:Id.BoolUnary_d child:{(/etc/rc.d/init.d)}) ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:sysvdir) op: assign_op.Equal rhs: {(/etc/rc.d/init.d)} spids: [58] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:sysvdir) op: assign_op.Equal rhs: {(/etc/init.d)} spids: [65] ) ] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:services) op: assign_op.Equal rhs: { (sh_array_literal left: (Token id:Id.Op_LParen val:'(' span_id:71) words: [ { (command_sub left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:73) command_list: (command.CommandList children: [ (C {(printf)} {(SQ (Token id:Id.Lit_Chars val:'%s ' span_id:77))} {($ Id.VSub_DollarName '$sysvdir') (/) (word_part.ExtGlob op: (Token id:Id.ExtGlob_Bang val:'!(' span_id:82) arms: [ {(README) (Id.Lit_Other '*')} {(Id.Lit_Other '*') (.sh)} {($ Id.VSub_DollarName '$_backup_glob')} ] ) } ) ] ) ) } ] ) } spids: [70] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:services) op: assign_op.Equal rhs: { (sh_array_literal left: (Token id:Id.Op_LParen val:'(' span_id:97) words: [ { (braced_var_sub token: (Token id:Id.VSub_Name val:services span_id:100) bracket_op: (bracket_op.WholeArray op_id:Id.Lit_At) suffix_op: (suffix_op.Unary op_id: Id.VOp1_Pound arg_word: {($ Id.VSub_DollarName '$sysvdir') (Id.Lit_Slash /)} ) ) } ] ) } spids: [96] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:options) op: assign_op.Equal rhs: { (sh_array_literal left: (Token id:Id.Op_LParen val:'(' span_id:113) words: [{(-f)} {(-n)}] ) } spids: [112] ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DBracket expr: (bool_expr.LogicalOr left: (bool_expr.Binary op_id: Id.BoolBinary_eq left: {($ Id.VSub_DollarName '$cword')} right: {(1)} ) right: (bool_expr.Binary op_id: Id.BoolBinary_GlobDEqual left: {(DQ ($ Id.VSub_DollarName '$prev'))} right: {(-) (Id.Lit_Other '*')} ) ) ) terminator: (Token id:Id.Op_Semi val:';' span_id:145) ) ] action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:valid_options) op: assign_op.Equal rhs: { (sh_array_literal left: (Token id:Id.Op_LParen val:'(' span_id:151) words: [ { (command_sub left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:153) command_list: (command.CommandList children: [ (command.Pipeline children: [ (command.Simple words: [ {(tr)} {(DQ (' '))} {(DQ (Id.Lit_Other '\\') (n))} ] redirects: [ (redir.Redir op: (Token id: Id.Redir_TLess val: '<<<' span_id: 168 ) fd: -1 arg_word: { (DQ (braced_var_sub token: (Token id: Id.VSub_Name val: words span_id: 171 ) bracket_op: (bracket_op.WholeArray op_id: Id.Lit_At ) ) (' ') (braced_var_sub token: (Token id: Id.VSub_Name val: options span_id: 178 ) bracket_op: (bracket_op.WholeArray op_id: Id.Lit_At ) ) ) } ) ] ) (C {(sed)} {(-ne)} { (DQ (/) (command_sub left_token: (Token id: Id.Left_DollarParen val: '$(' span_id: 195 ) command_list: (command.CommandList children: [ (command.Simple words: [ {(sed)} { (DQ ('s/ /') (word_part.EscapedLiteral token: (Token id: Id.Lit_EscapedChar val: '\\\\' span_id: 201 ) ) ('|/g') ) } ] redirects: [ (redir.Redir op: (Token id: Id.Redir_TLess val: '<<<' span_id: 205 ) fd: -1 arg_word: { (DQ (braced_var_sub token: (Token id: Id.VSub_Name val: options span_id: 208 ) bracket_op: (bracket_op.WholeArray op_id: Id.Lit_At ) ) ) } ) ] ) ] ) ) (/p) ) } ) (C {(sort)}) (C {(uniq)} {(-u)}) ] negated: F ) ] ) ) } ] ) } spids: [150] ) ] ) (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:239) words: [ { (command_sub left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:241) command_list: (command.CommandList children: [ (C {(compgen)} {(-W)} { (SQ (Token id: Id.Lit_Chars val: '${options[@]} ${services[@]}' span_id: 248 ) ) } {(-X)} {(SQ (Token id:Id.Lit_Chars val:'$( tr " " "|" <<<${words[@]} )' span_id:256))} {(--)} {(DQ ($ Id.VSub_DollarName '$cur'))} ) ] ) ) } ] ) } spids: [238] ) ] ) ] spids: [123 147] ) (if_arm cond: [ (command.Sentence child: (command.DBracket expr: (bool_expr.Binary op_id: Id.BoolBinary_GlobDEqual left: {(DQ ($ Id.VSub_DollarName '$prev'))} right: { (word_part.ExtGlob op: (Token id:Id.ExtGlob_QMark val:'?(' span_id:280) arms: [ { (command_sub left_token: (Token id: Id.Left_DollarParen val: '$(' span_id: 281 ) command_list: (command.CommandList children: [ (command.Simple words: [{(tr)} {(DQ (' '))} {(DQ ('|'))}] redirects: [ (redir.Redir op: (Token id: Id.Redir_TLess val: '<<<' span_id: 293 ) fd: -1 arg_word: { (braced_var_sub token: (Token id: Id.VSub_Name val: services span_id: 295 ) bracket_op: (bracket_op.WholeArray op_id: Id.Lit_At ) ) } ) ] ) ] ) ) } ] ) } ) ) terminator: (Token id:Id.Op_Semi val:';' span_id:305) ) ] 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:311) words: [ { (command_sub left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:313) command_list: (command.CommandList children: [ (C {(compgen)} {(-W)} { (SQ (Token id: Id.Lit_Chars val: 'remove defaults start stop' span_id: 320 ) ) } {(--)} {(DQ ($ Id.VSub_DollarName '$cur'))} ) ] ) ) } ] ) } spids: [310] ) ] ) ] spids: [270 307] ) (if_arm cond: [ (command.Sentence child: (command.DBracket expr: (bool_expr.LogicalAnd left: (bool_expr.Binary op_id: Id.BoolBinary_GlobDEqual left: {(DQ ($ Id.VSub_DollarName '$prev'))} right: {(defaults)} ) right: (bool_expr.Binary op_id: Id.BoolBinary_GlobDEqual left: {(DQ ($ Id.VSub_DollarName '$cur'))} right: {(Id.Lit_Other '[') (0-9) (Id.Lit_Other ']')} ) ) ) terminator: (Token id:Id.Op_Semi val:';' span_id:359) ) ] 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:365) words: [{(0)} {(1)} {(2)} {(3)} {(4)} {(5)} {(6)} {(7)} {(8)} {(9)}] ) } spids: [364] ) ] ) ] spids: [334 361] ) (if_arm cond: [ (command.Sentence child: (command.DBracket expr: (bool_expr.LogicalAnd left: (bool_expr.Binary op_id: Id.BoolBinary_GlobDEqual left: {(DQ ($ Id.VSub_DollarName '$prev'))} right: {(defaults)} ) right: (bool_expr.Binary op_id: Id.BoolBinary_GlobDEqual left: {(DQ ($ Id.VSub_DollarName '$cur'))} right: {(Id.Lit_Other '[') (sk) (Id.Lit_Other ']') (word_part.ExtGlob op: (Token id:Id.ExtGlob_QMark val:'?(' span_id:413) arms: [{('[0-9]')}] ) } ) ) ) terminator: (Token id:Id.Op_Semi val:';' span_id:418) ) ] 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:424) words: [{(0)} {(1)} {(2)} {(3)} {(4)} {(5)} {(6)} {(7)} {(8)} {(9)}] ) } spids: [423] ) ] ) ] spids: [390 420] ) (if_arm cond: [ (command.Sentence child: (command.DBracket expr: (bool_expr.LogicalAnd left: (bool_expr.Binary op_id: Id.BoolBinary_GlobDEqual left: {(DQ ($ Id.VSub_DollarName '$prev'))} right: {(defaults)} ) right: (bool_expr.Unary op_id: Id.BoolUnary_z child: {(DQ ($ Id.VSub_DollarName '$cur'))} ) ) ) terminator: (Token id:Id.Op_Semi val:';' span_id:470) ) ] 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:476) words: [{(0)} {(1)} {(2)} {(3)} {(4)} {(5)} {(6)} {(7)} {(8)} {(9)} {(s)} {(k)}] ) } spids: [475] ) ] ) ] spids: [449 472] ) (if_arm cond: [ (command.Sentence child: (command.DBracket expr: (bool_expr.Binary op_id: Id.BoolBinary_GlobDEqual left: {(DQ ($ Id.VSub_DollarName '$prev'))} right: { (word_part.ExtGlob op: (Token id:Id.ExtGlob_QMark val:'?(' span_id:515) arms: [{(start)} {(stop)}] ) } ) ) terminator: (Token id:Id.Op_Semi val:';' span_id:522) ) ] action: [ (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DBracket expr: (bool_expr.LogicalOr left: (bool_expr.Binary op_id: Id.BoolBinary_GlobDEqual left: {(DQ ($ Id.VSub_DollarName '$cur'))} right: {(Id.Lit_Other '[') (0-9) (Id.Lit_Other ']')} ) right: (bool_expr.Unary op_id: Id.BoolUnary_z child: {(DQ ($ Id.VSub_DollarName '$cur'))} ) ) ) terminator: (Token id:Id.Op_Semi val:';' span_id:550) ) ] 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:556) words: [{(0)} {(1)} {(2)} {(3)} {(4)} {(5)} {(6)} {(7)} {(8)} {(9)}] ) } spids: [555] ) ] ) ] spids: [527 552] ) (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 '[') (0-9) (Id.Lit_Other ']') (Id.Lit_Other '[') (0-9) (Id.Lit_Other ']') } ) ) terminator: (Token id:Id.Op_Semi val:';' span_id:599) ) ] 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:605) words: [{($ Id.VSub_DollarName '$cur')}] ) } spids: [604] ) ] ) ] spids: [581 601] ) ] else_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:616))} spids: [615] ) ] ) ] ) ] spids: [505 524] ) (if_arm cond: [ (command.Sentence child: (command.DBracket expr: (bool_expr.Binary op_id: Id.BoolBinary_GlobDEqual left: {(DQ ($ Id.VSub_DollarName '$prev'))} right: { (word_part.ExtGlob op: (Token id:Id.ExtGlob_QMark val:'?(' span_id:633) arms: [{('[0-9][0-9]')} {('[0-6S]')}] ) } ) ) terminator: (Token id:Id.Op_Semi val:';' span_id:640) ) ] action: [ (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DBracket expr: (bool_expr.Unary op_id: Id.BoolUnary_z child: {(DQ ($ Id.VSub_DollarName '$cur'))} ) ) terminator: (Token id:Id.Op_Semi val:';' span_id:656) ) ] action: [ (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DBracket expr: (bool_expr.Binary op_id: Id.BoolBinary_GlobDEqual left: {($ Id.VSub_DollarName '$prev')} right: {(Id.Lit_Other '[') (0-9) (Id.Lit_Other ']') (Id.Lit_Other '[') (0-9) (Id.Lit_Other ']') } ) ) terminator: (Token id:Id.Op_Semi val:';' span_id:677) ) ] 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:683) words: [{(0)} {(1)} {(2)} {(3)} {(4)} {(5)} {(6)} {(S)}] ) } spids: [682] ) ] ) ] spids: [661 679] ) ] else_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:708) words: [{(0)} {(1)} {(2)} {(3)} {(4)} {(5)} {(6)} {(S)} {(.)}] ) } spids: [707] ) ] ) ] ) ] spids: [645 658] ) (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 '[') (0-6S.) (Id.Lit_Other ']')} ) ) terminator: (Token id:Id.Op_Semi val:';' span_id:749) ) ] 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:755) words: [{($ Id.VSub_DollarName '$cur')}] ) } spids: [754] ) ] ) ] spids: [734 751] ) ] else_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:766))} spids: [765] ) ] ) ] ) ] spids: [623 642] ) (if_arm cond: [ (command.Sentence child: (command.DBracket expr: (bool_expr.Binary op_id: Id.BoolBinary_GlobDEqual left: {(DQ ($ Id.VSub_DollarName '$prev'))} right: {(DQ (.))} ) ) terminator: (Token id:Id.Op_Semi val:';' span_id:788) ) ] 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:794) words: [ { (command_sub left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:796) command_list: (command.CommandList children: [ (C {(compgen)} {(-W)} {(DQ ('start stop'))} {(--)} {(DQ ($ Id.VSub_DollarName '$cur'))} ) ] ) ) } ] ) } spids: [793] ) ] ) ] spids: [773 790] ) ] else_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:821))} spids: [820] ) ] ) ] ) (command.ControlFlow token: (Token id:Id.ControlFlow_Return val:return span_id:829) arg_word: {(0)} ) ] ) ) (C {(complete)} {(-F)} {(_update_rc_d)} {(update-rc.d)}) ] )