(command.CommandList children: [ (command.ShFunction name: Usage body: (command.BraceGroup children: [ (command.Simple words: [ {(echo)} { (DQ ('Usage: ') (command_sub left_token: (Token id:Id.Left_Backtick val:'`' span_id:24) command_list: (command.CommandList children: [(C {(basename)} {($ Id.VSub_Number '$0')})] ) ) (' mon|tue|... [next]|week|last') ) } ] redirects: [ (redir.Redir op: (Token id:Id.Redir_GreatAnd val:'>&' span_id:34) fd: -1 arg_word: {(2)} ) ] ) (command.ControlFlow token: (Token id:Id.ControlFlow_Exit val:exit span_id:38) arg_word: {(1)} ) ] ) ) (command.AndOr ops: [Id.Op_DAmp] children: [ (C {(Id.Lit_LBracket '[')} {(DQ ($ Id.VSub_Pound '$#'))} {(-eq)} {(DQ (0))} {(Id.Lit_RBracket ']')} ) (C {(Usage)}) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:day) op: assign_op.Equal rhs: {($ Id.VSub_Number '$1')} spids: [64] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:which) op: assign_op.Equal rhs: {($ Id.VSub_Number '$2')} spids: [67] ) ] ) (command.AndOr ops: [Id.Op_DAmp] children: [ (C {(Id.Lit_LBracket '[')} {(-z)} {(DQ ($ Id.VSub_DollarName '$which'))} {(Id.Lit_RBracket ']')}) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:which) op: assign_op.Equal rhs: {(next)} spids: [82] ) ] ) ] ) (command.Case to_match: {($ Id.VSub_DollarName '$which')} arms: [ (case_arm pat_list: [{(week)}] action: [ (command.If arms: [ (if_arm cond: [ (command.Sentence child: (C {(Id.Lit_LBracket '[')} { (command_sub left_token: (Token id:Id.Left_Backtick val:'`' span_id:100) command_list: (command.CommandList children: [(C {(date)} {(Id.Lit_Other '+') (Id.Lit_Other '%') (D)})] ) ) } {(Id.Lit_Equals '=')} { (command_sub left_token: (Token id:Id.Left_Backtick val:'`' span_id:112) command_list: (command.CommandList children: [ (C {(date)} {(--date) (Id.Lit_Equals '=') (DQ ('next ') ($ Id.VSub_DollarName '$day')) } {(Id.Lit_Other '+') (Id.Lit_Other '%') (D)} ) ] ) ) } {(Id.Lit_RBracket ']')} ) terminator: (Token id:Id.Op_Semi val:';' span_id:130) ) ] action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:weeks) op: assign_op.Equal rhs: {(Id.Lit_Other '+') (2)} spids: [135] ) ] ) ] spids: [96 132] ) ] else_action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:weeks) op: assign_op.Equal rhs: {(Id.Lit_Other '+') (1)} spids: [146] ) ] ) ] ) ] spids: [92 93 153 -1] ) (case_arm pat_list: [{(last)}] action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:weeks) op: assign_op.Equal rhs: {(-1)} spids: [159] ) ] ) ] spids: [155 156 161 -1] ) (case_arm pat_list: [{(next)}] action: [ (command.If arms: [ (if_arm cond: [ (command.Sentence child: (C {(Id.Lit_LBracket '[')} { (command_sub left_token: (Token id:Id.Left_Backtick val:'`' span_id:171) command_list: (command.CommandList children: [(C {(date)} {(Id.Lit_Other '+') (Id.Lit_Other '%') (D)})] ) ) } {(Id.Lit_Equals '=')} { (command_sub left_token: (Token id:Id.Left_Backtick val:'`' span_id:183) command_list: (command.CommandList children: [ (C {(date)} {(--date) (Id.Lit_Equals '=') (DQ ('next ') ($ Id.VSub_DollarName '$day')) } {(Id.Lit_Other '+') (Id.Lit_Other '%') (D)} ) ] ) ) } {(Id.Lit_RBracket ']')} ) terminator: (Token id:Id.Op_Semi val:';' span_id:201) ) ] action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:weeks) op: assign_op.Equal rhs: {(Id.Lit_Other '+') (1)} spids: [206] ) ] ) ] spids: [167 203] ) ] else_action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:weeks) op: assign_op.Equal rhs: {(Id.Lit_Other '+') (0)} spids: [217] ) ] ) ] ) ] spids: [163 164 224 -1] ) (case_arm pat_list: [{(Id.Lit_Star '*')}] action: [(C {(Usage)})] spids: [226 227 231 -1] ) ] ) (C {(date)} {(--date) (Id.Lit_Equals '=') (DQ ($ Id.VSub_DollarName '$day') (' ') ($ Id.VSub_DollarName '$weeks') (' weeks')) } {(Id.Lit_Other '+') (Id.Lit_Other '%') (x)} ) ] )