(command.CommandList
  children: [
    (command.FuncDef
      name: usage
      body: 
        (command.BraceGroup
          children: [
            (command.SimpleCommand
              words: [{(cat)}]
              redirects: [
                (redir.HereDoc
                  op: <Redir_DLess '<<'>
                  fd: 16777215
                  here_begin: {(EOF)}
                  here_end_span_id: 74
                  stdin_parts: [
                    ('Usage: ')
                    (word_part.CommandSubPart
                      command_list: 
                        (command.CommandList
                          children: [(C {(basename)} {($ VSub_Number '$0')})]
                        )
                      left_token: <Left_DollarParen '$('>
                    )
                    (' -b border -c color imagename\n')
                    ('   or  ')
                    (word_part.CommandSubPart
                      command_list: 
                        (command.CommandList
                          children: [(C {(basename)} {($ VSub_Number '$0')})]
                        )
                      left_token: <Left_DollarParen '$('>
                    )
                    (' -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')
                    ('   ')
                    (word_part.CommandSubPart
                      command_list: 
                        (command.CommandList
                          children: [(C {(basename)} {($ VSub_Number '$0')})]
                        )
                      left_token: <Left_DollarParen '$('>
                    )
                    (' -b 15x15 -c black imagename\n')
                    ('   ')
                    (word_part.CommandSubPart
                      command_list: 
                        (command.CommandList
                          children: [(C {(basename)} {($ VSub_Number '$0')})]
                        )
                      left_token: <Left_DollarParen '$('>
                    )
                    (' -b 10%x10% -c grey imagename\n')
                    ('\n')
                    ('   ')
                    (word_part.CommandSubPart
                      command_list: 
                        (command.CommandList
                          children: [(C {(basename)} {($ VSub_Number '$0')})]
                        )
                      left_token: <Left_DollarParen '$('>
                    )
                    (' -f 10x10+10+0 imagename\n')
                    ('   ')
                    (word_part.CommandSubPart
                      command_list: 
                        (command.CommandList
                          children: [(C {(basename)} {($ VSub_Number '$0')})]
                        )
                      left_token: <Left_DollarParen '$('>
                    )
                    (' -f 6x6+2+2 -m tomato imagename\n')
                  ]
                )
              ]
            )
            (command.ControlFlow token:<ControlFlow_Exit exit> arg_word:{(1)})
          ]
        )
    )
    (command.WhileUntil
      keyword: <KW_While while>
      cond: [
        (command.Sentence
          child: (C {(getopts)} {(DQ ('b:c:f:m:'))} {(opt)})
          terminator: <Op_Semi ';'>
        )
      ]
      body: 
        (command.DoGroup
          children: [
            (command.Case
              to_match: {($ VSub_DollarName '$opt')}
              arms: [
                (case_arm
                  pat_list: [{(b)}]
                  action: [
                    (command.Sentence
                      child: 
                        (command.Assignment
                          keyword: Assign_None
                          pairs: [
                            (assign_pair
                              lhs: (lhs_expr.LhsName name:border)
                              op: Equal
                              rhs: {(DQ ($ VSub_DollarName '$OPTARG'))}
                            )
                          ]
                        )
                      terminator: <Op_Semi ';'>
                    )
                  ]
                )
                (case_arm
                  pat_list: [{(c)}]
                  action: [
                    (command.Sentence
                      child: 
                        (command.Assignment
                          keyword: Assign_None
                          pairs: [
                            (assign_pair
                              lhs: (lhs_expr.LhsName name:bordercolor)
                              op: Equal
                              rhs: {(DQ ($ VSub_DollarName '$OPTARG'))}
                            )
                          ]
                        )
                      terminator: <Op_Semi ';'>
                    )
                  ]
                )
                (case_arm
                  pat_list: [{(f)}]
                  action: [
                    (command.Sentence
                      child: 
                        (command.Assignment
                          keyword: Assign_None
                          pairs: [
                            (assign_pair
                              lhs: (lhs_expr.LhsName name:frame)
                              op: Equal
                              rhs: {(DQ ($ VSub_DollarName '$OPTARG'))}
                            )
                          ]
                        )
                      terminator: <Op_Semi ';'>
                    )
                  ]
                )
                (case_arm
                  pat_list: [{(m)}]
                  action: [
                    (command.Sentence
                      child: 
                        (command.Assignment
                          keyword: Assign_None
                          pairs: [
                            (assign_pair
                              lhs: (lhs_expr.LhsName name:mattecolor)
                              op: Equal
                              rhs: {(DQ ($ VSub_DollarName '$OPTARG'))}
                            )
                          ]
                        )
                      terminator: <Op_Semi ';'>
                    )
                  ]
                )
                (case_arm
                  pat_list: [{(Lit_Other '?')}]
                  action: [(command.Sentence child:(C {(usage)}) terminator:<Op_Semi ';'>)]
                )
              ]
            )
          ]
        )
    )
    (C {(shift)} 
      {
        (word_part.ArithSubPart
          anode: 
            (arith_expr.ArithBinary
              op_id: Arith_Minus
              left: (arith_expr.ArithWord w:{($ VSub_DollarName '$OPTIND')})
              right: (arith_expr.ArithWord w:{(Lit_Digits 1)})
            )
        )
      }
    )
    (command.If
      arms: [
        (if_arm
          cond: [
            (command.Sentence
              child: (C {(Lit_Other '[')} {($ VSub_Pound '$#')} {(-eq)} {(0)} {(Lit_Other ']')})
              terminator: <Op_Semi ';'>
            )
          ]
          action: [(C {(usage)})]
        )
      ]
    )
    (command.If
      arms: [
        (if_arm
          cond: [
            (command.Sentence
              child: 
                (C {(Lit_Other '[')} {(KW_Bang '!')} {(-z)} {(DQ ($ VSub_DollarName '$bordercolor'))} 
                  {(-a)} {(KW_Bang '!')} {(-z)} {(DQ ($ VSub_DollarName '$mattecolor'))} {(Lit_Other ']')}
                )
              terminator: <Op_Semi ';'>
            )
          ]
          action: [
            (command.SimpleCommand
              words: [
                {(echo)}
                {
                  (DQ 
                    (word_part.CommandSubPart
                      command_list: 
                        (command.CommandList
                          children: [(C {(basename)} {($ VSub_Number '$0')})]
                        )
                      left_token: <Left_DollarParen '$('>
                    ) (": You can't specify a color and matte color simultaneously.")
                  )
                }
              ]
              redirects: [(redir.Redir op:<Redir_GreatAnd '>&'> fd:16777215 arg_word:{(2)})]
            )
            (command.ControlFlow token:<ControlFlow_Exit exit> arg_word:{(1)})
          ]
        )
      ]
    )
    (command.If
      arms: [
        (if_arm
          cond: [
            (command.Sentence
              child: 
                (C {(Lit_Other '[')} {(KW_Bang '!')} {(-z)} {(DQ ($ VSub_DollarName '$frame'))} {(-a)} 
                  {(KW_Bang '!')} {(-z)} {(DQ ($ VSub_DollarName '$border'))} {(Lit_Other ']')}
                )
              terminator: <Op_Semi ';'>
            )
          ]
          action: [
            (command.SimpleCommand
              words: [
                {(echo)}
                {
                  (DQ 
                    (word_part.CommandSubPart
                      command_list: 
                        (command.CommandList
                          children: [(C {(basename)} {($ VSub_Number '$0')})]
                        )
                      left_token: <Left_DollarParen '$('>
                    ) (": You can't specify a border and frame simultaneously.")
                  )
                }
              ]
              redirects: [(redir.Redir op:<Redir_GreatAnd '>&'> fd:16777215 arg_word:{(2)})]
            )
            (command.ControlFlow token:<ControlFlow_Exit exit> arg_word:{(1)})
          ]
        )
      ]
    )
    (command.If
      arms: [
        (if_arm
          cond: [
            (command.Sentence
              child: 
                (C {(Lit_Other '[')} {(KW_Bang '!')} {(-z)} {(DQ ($ VSub_DollarName '$border'))} 
                  {(Lit_Other ']')}
                )
              terminator: <Op_Semi ';'>
            )
          ]
          action: [
            (command.Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (lhs_expr.LhsName name:args)
                  op: Equal
                  rhs: 
                    {
                      (DQ ('-bordercolor ') ($ VSub_DollarName '$bordercolor') (' -border ') 
                        ($ VSub_DollarName '$border')
                      )
                    }
                )
              ]
            )
          ]
        )
      ]
      else_action: [
        (command.Assignment
          keyword: Assign_None
          pairs: [
            (assign_pair
              lhs: (lhs_expr.LhsName name:args)
              op: Equal
              rhs: 
                {
                  (DQ ('-mattecolor ') ($ VSub_DollarName '$mattecolor') (' -frame ') 
                    ($ VSub_DollarName '$frame')
                  )
                }
            )
          ]
        )
      ]
    )
    (command.ForEach
      iter_name: name
      do_arg_iter: T
      body: 
        (command.DoGroup
          children: [
            (command.Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (lhs_expr.LhsName name:suffix)
                  op: Equal
                  rhs: 
                    {
                      (DQ 
                        (word_part.CommandSubPart
                          command_list: 
                            (command.CommandList
                              children: [
                                (command.Pipeline
                                  children: [
                                    (C {(echo)} {($ VSub_DollarName '$name')})
                                    (C {(rev)})
                                    (C {(cut)} {(-d.)} {(-f1)})
                                    (C {(rev)})
                                  ]
                                  negated: F
                                )
                              ]
                            )
                          left_token: <Left_DollarParen '$('>
                        )
                      )
                    }
                )
              ]
            )
            (command.Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (lhs_expr.LhsName name:prefix)
                  op: Equal
                  rhs: 
                    {
                      (DQ 
                        (word_part.CommandSubPart
                          command_list: 
                            (command.CommandList
                              children: [
                                (command.Pipeline
                                  children: [
                                    (C {(echo)} {($ VSub_DollarName '$name')})
                                    (C {(rev)})
                                    (C {(cut)} {(-d.)} {(-f2-)})
                                    (C {(rev)})
                                  ]
                                  negated: F
                                )
                              ]
                            )
                          left_token: <Left_DollarParen '$('>
                        )
                      )
                    }
                )
              ]
            )
            (command.Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (lhs_expr.LhsName name:newname)
                  op: Equal
                  rhs: {(DQ ($ VSub_DollarName '$prefix') ('+f.') ($ VSub_DollarName '$suffix'))}
                )
              ]
            )
            (C {(echo)} 
              {
                (DQ ('Adding a frame to image ') ($ VSub_DollarName '$name') (', saving as ') 
                  ($ VSub_DollarName '$newname')
                )
              }
            )
            (C {(convert)} {($ VSub_DollarName '$name')} {($ VSub_DollarName '$args')} 
              {($ VSub_DollarName '$newname')}
            )
          ]
        )
    )
    (command.ControlFlow token:<ControlFlow_Exit exit> arg_word:{(0)})
  ]
)