(CommandList children: [ (FuncDef name: usage body: (BraceGroup children: [ (SimpleCommand words: [{(cat)}] redirects: [ (HereDoc op_id: Redir_DLess fd: -1 body: { (DQ ('Usage: ') (CommandSubPart command_list: (CommandList children: [(C {(basename)} {($ VSub_Number '$0')})] ) left_token: <Left_CommandSub '$('> spids: [23 27] ) (' -b border -c color imagename\n') (' or ') (CommandSubPart command_list: (CommandList children: [(C {(basename)} {($ VSub_Number '$0')})] ) left_token: <Left_CommandSub '$('> spids: [30 34] ) (' -f frame -m color imagename\n') ('\n') ( 'In the first case, specify border parameters as size x size or percentage x percentage\n' ) ('followed by the color desired for the border (RGB or color name).\n') ('\n') ( 'In the second instance, specify the frame size and offset, followed by the\n' ) ('matte color.\n') ('\n') ('EXAMPLE USAGE:\n') (' ') (CommandSubPart command_list: (CommandList children: [(C {(basename)} {($ VSub_Number '$0')})] ) left_token: <Left_CommandSub '$('> spids: [45 49] ) (' -b 15x15 -c black imagename\n') (' ') (CommandSubPart command_list: (CommandList children: [(C {(basename)} {($ VSub_Number '$0')})] ) left_token: <Left_CommandSub '$('> spids: [52 56] ) (' -b 10%x10% -c grey imagename\n') ('\n') (' ') (CommandSubPart command_list: (CommandList children: [(C {(basename)} {($ VSub_Number '$0')})] ) left_token: <Left_CommandSub '$('> spids: [60 64] ) (' -f 10x10+10+0 imagename\n') (' ') (CommandSubPart command_list: (CommandList children: [(C {(basename)} {($ VSub_Number '$0')})] ) left_token: <Left_CommandSub '$('> spids: [67 71] ) (' -f 6x6+2+2 -m tomato imagename\n') ) } do_expansion: True here_end: EOF was_filled: True spids: [18] ) ] ) (C {(exit)} {(1)}) ] spids: [14] ) spids: [10 13] ) (While cond: [(Sentence child:(C {(getopts)} {(DQ ('b:c:f:m:'))} {(opt)}) terminator:<Op_Semi ';'>)] body: (DoGroup children: [ (Case to_match: {($ VSub_Name '$opt')} arms: [ (case_arm pat_list: [{(b)}] action: [ (Sentence child: (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:border) op: Equal rhs: {(DQ ($ VSub_Name '$OPTARG'))} spids: [114] ) ] spids: [114] ) terminator: <Op_Semi ';'> ) ] spids: [110 112 120 -1] ) (case_arm pat_list: [{(c)}] action: [ (Sentence child: (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:bordercolor) op: Equal rhs: {(DQ ($ VSub_Name '$OPTARG'))} spids: [127] ) ] spids: [127] ) terminator: <Op_Semi ';'> ) ] spids: [123 125 133 -1] ) (case_arm pat_list: [{(f)}] action: [ (Sentence child: (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:frame) op: Equal rhs: {(DQ ($ VSub_Name '$OPTARG'))} spids: [140] ) ] spids: [140] ) terminator: <Op_Semi ';'> ) ] spids: [136 138 146 -1] ) (case_arm pat_list: [{(m)}] action: [ (Sentence child: (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:mattecolor) op: Equal rhs: {(DQ ($ VSub_Name '$OPTARG'))} spids: [153] ) ] spids: [153] ) terminator: <Op_Semi ';'> ) ] spids: [149 151 159 -1] ) (case_arm pat_list: [{(Lit_Other '?')}] action: [(Sentence child:(C {(usage)}) terminator:<Op_Semi ';'>)] spids: [162 164 169 -1] ) ] spids: [103 107 172] ) ] spids: [100 174] ) ) (C {(shift)} { (ArithSubPart anode: (ArithBinary op_id: Arith_Minus left: (ArithWord w:{($ VSub_Name '$OPTIND')}) right: (ArithWord w:{(Lit_Digits 1)}) ) spids: [178 185] ) } ) (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other '[')} {($ VSub_Pound '$#')} {(-eq)} {(0)} {(Lit_Other ']')}) terminator: <Op_Semi ';'> ) ] action: [(C {(usage)})] spids: [-1 205] ) ] spids: [-1 213] ) (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other '[')} {(KW_Bang '!')} {(-z)} {(DQ ($ VSub_Name '$bordercolor'))} {(-a)} {(KW_Bang '!')} {(-z)} {(DQ ($ VSub_Name '$mattecolor'))} {(Lit_Other ']')} ) terminator: <Op_Semi ';'> ) ] action: [ (SimpleCommand words: [ {(echo)} { (DQ (CommandSubPart command_list: (CommandList children:[(C {(basename)} {($ VSub_Number '$0')})]) left_token: <Left_CommandSub '$('> spids: [252 256] ) (": You can't specify a color and matte color simultaneously.") ) } ] redirects: [(Redir op_id:Redir_GreatAnd fd:-1 arg_word:{(2)} spids:[260])] ) (C {(exit)} {(1)}) ] spids: [-1 246] ) ] spids: [-1 268] ) (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other '[')} {(KW_Bang '!')} {(-z)} {(DQ ($ VSub_Name '$frame'))} {(-a)} {(KW_Bang '!')} {(-z)} {(DQ ($ VSub_Name '$border'))} {(Lit_Other ']')} ) terminator: <Op_Semi ';'> ) ] action: [ (SimpleCommand words: [ {(echo)} { (DQ (CommandSubPart command_list: (CommandList children:[(C {(basename)} {($ VSub_Number '$0')})]) left_token: <Left_CommandSub '$('> spids: [303 307] ) (": You can't specify a border and frame simultaneously.") ) } ] redirects: [(Redir op_id:Redir_GreatAnd fd:-1 arg_word:{(2)} spids:[311])] ) (C {(exit)} {(1)}) ] spids: [-1 297] ) ] spids: [-1 319] ) (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other '[')} {(KW_Bang '!')} {(-z)} {(DQ ($ VSub_Name '$border'))} {(Lit_Other ']')} ) terminator: <Op_Semi ';'> ) ] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:args) op: Equal rhs: { (DQ ('-bordercolor ') ($ VSub_Name '$bordercolor') (' -border ') ($ VSub_Name '$border') ) } spids: [341] ) ] spids: [341] ) ] spids: [-1 338] ) ] else_action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:args) op: Equal rhs: { (DQ ('-mattecolor ') ($ VSub_Name '$mattecolor') (' -frame ') ($ VSub_Name '$frame')) } spids: [352] ) ] spids: [352] ) ] spids: [349 360] ) (ForEach iter_name: name do_arg_iter: True body: (DoGroup children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:suffix) op: Equal rhs: { (DQ (CommandSubPart command_list: (CommandList children: [ (Pipeline children: [ (C {(echo)} {($ VSub_Name '$name')}) (C {(rev)}) (C {(cut)} {(-d.)} {(-f1)}) (C {(rev)}) ] negated: False ) ] ) left_token: <Left_CommandSub '$('> spids: [373 393] ) ) } spids: [371] ) ] spids: [371] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:prefix) op: Equal rhs: { (DQ (CommandSubPart command_list: (CommandList children: [ (Pipeline children: [ (C {(echo)} {($ VSub_Name '$name')}) (C {(rev)}) (C {(cut)} {(-d.)} {(-f2-)}) (C {(rev)}) ] negated: False ) ] ) left_token: <Left_CommandSub '$('> spids: [399 419] ) ) } spids: [397] ) ] spids: [397] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:newname) op: Equal rhs: {(DQ ($ VSub_Name '$prefix') ('+f.') ($ VSub_Name '$suffix'))} spids: [423] ) ] spids: [423] ) (C {(echo)} { (DQ ('Adding a frame to image ') ($ VSub_Name '$name') (', saving as ') ($ VSub_Name '$newname') ) } ) (C {(convert)} {($ VSub_Name '$name')} {($ VSub_Name '$args')} {($ VSub_Name '$newname')}) ] spids: [368 449] ) spids: [-1 -1] ) (C {(exit)} {(0)}) ] )