(command.CommandList
  children: [
    (command.ShFunction
      name: usage
      body: 
        (command.BraceGroup
          children: [
            (command.Subshell
              command_list: 
                (command.CommandList
                  children: [
                    (C {(echo)} 
                      {
                        (DQ ('Usage:    ') 
                          (command_sub
                            left_token: (Token id:Id.Left_Backtick val:'`' span_id:84)
                            command_list: 
                              (command.CommandList
                                children: [(C {(basename)} {($ Id.VSub_Number '$0')})]
                              )
                          ) (" ['grep options'] search_expr [file wildcard]\n") ('examples: ') 
                          (command_sub
                            left_token: (Token id:Id.Left_Backtick val:'`' span_id:93)
                            command_list: 
                              (command.CommandList
                                children: [(C {(basename)} {($ Id.VSub_Number '$0')})]
                              )
                          ) (" 'main' '*.[ch]'          #fixed string search\n") ('          ') 
                          (command_sub
                            left_token: (Token id:Id.Left_Backtick val:'`' span_id:102)
                            command_list: 
                              (command.CommandList
                                children: [(C {(basename)} {($ Id.VSub_Number '$0')})]
                              )
                          ) (" '(main|mane)' '*.[ch]'   #regular expression search\n") ('          ') 
                          (command_sub
                            left_token: (Token id:Id.Left_Backtick val:'`' span_id:111)
                            command_list: 
                              (command.CommandList
                                children: [(C {(basename)} {($ Id.VSub_Number '$0')})]
                              )
                          ) (" '-F' 'main(' '*.[ch]'    #force fixed string search\n") ('          ') 
                          (command_sub
                            left_token: (Token id:Id.Left_Backtick val:'`' span_id:120)
                            command_list: 
                              (command.CommandList
                                children: [(C {(basename)} {($ Id.VSub_Number '$0')})]
                              )
                          ) (" '-L -F' 'main(' '*.[ch]' #extra grep options")
                        )
                      }
                    )
                  ]
                )
              redirects: [
                (redir.Redir
                  op: (Token id:Id.Redir_GreatAnd val:'>&' span_id:132)
                  fd: -1
                  arg_word: {(2)}
                )
              ]
            )
            (command.ControlFlow
              token: (Token id:Id.ControlFlow_Exit val:exit span_id:136)
              arg_word: {(1)}
            )
          ]
        )
    )
    (command.If
      arms: [
        (if_arm
          cond: [
            (command.Sentence
              child: 
                (command.AndOr
                  ops: [Id.Op_DPipe]
                  children: [
                    (C {(Id.Lit_LBracket '[')} {($ Id.VSub_Pound '$#')} {(-eq)} {(0)} 
                      {(Id.Lit_RBracket ']')}
                    )
                    (C {(Id.Lit_LBracket '[')} {($ Id.VSub_Pound '$#')} {(-gt)} {(3)} 
                      {(Id.Lit_RBracket ']')}
                    )
                  ]
                )
              terminator: (Token id:Id.Op_Semi val:';' span_id:166)
            )
          ]
          action: [(C {(usage)})]
          spids: [143 168]
        )
      ]
    )
    (command.AndOr
      ops: [Id.Op_DAmp]
      children: [
        (command.Pipeline
          children: [
            (C {(echo)})
            (command.Simple
              words: [{(grep)} {(--color) (Id.Lit_Equals '=') (auto)} {(DQ )}]
              redirects: [
                (redir.Redir
                  op: (Token id:Id.Redir_Great val:'>' span_id:192)
                  fd: -1
                  arg_word: {(/dev/null)}
                )
                (redir.Redir
                  op: (Token id:Id.Redir_GreatAnd val:'2>&' span_id:195)
                  fd: 2
                  arg_word: {(1)}
                )
              ]
            )
          ]
          negated: F
        )
        (command.ShAssignment
          pairs: [
            (assign_pair
              lhs: (sh_lhs_expr.Name name:colour)
              op: assign_op.Equal
              rhs: {(DQ ('--color=auto'))}
              spids: [200]
            )
          ]
        )
      ]
    )
    (command.If
      arms: [
        (if_arm
          cond: [
            (command.Sentence
              child: 
                (C {(Id.Lit_LBracket '[')} {($ Id.VSub_Pound '$#')} {(-eq)} {(1)} {(Id.Lit_RBracket ']')})
              terminator: (Token id:Id.Op_Semi val:';' span_id:217)
            )
          ]
          action: [
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:glob)
                  op: assign_op.Equal
                  rhs: {(SQ (Token id:Id.Lit_Chars val:'*' span_id:224))}
                  spids: [222]
                )
              ]
            )
          ]
          spids: [206 219]
        )
        (if_arm
          cond: [
            (command.Sentence
              child: 
                (C {(Id.Lit_LBracket '[')} {($ Id.VSub_Pound '$#')} {(-eq)} {(2)} {(Id.Lit_RBracket ']')})
              terminator: (Token id:Id.Op_Semi val:';' span_id:241)
            )
          ]
          action: [
            (command.If
              arms: [
                (if_arm
                  cond: [
                    (command.Sentence
                      child: 
                        (command.Pipeline
                          children: [
                            (C {(test)} 
                              {
                                (DQ 
                                  (braced_var_sub
                                    token: (Token id:Id.VSub_Number val:1 span_id:266)
                                    suffix_op: (suffix_op.Unary op_id:Id.VOp1_DPound arg_word:{('-*')})
                                  )
                                )
                              }
                            )
                          ]
                          negated: T
                        )
                      terminator: (Token id:Id.Op_Semi val:';' span_id:271)
                    )
                  ]
                  action: [
                    (command.Simple
                      words: [
                        {(echo)}
                        {
                          (DQ ("Warning: treating '") ($ Id.VSub_Number '$1') 
                            ("' as the grep pattern, not extra options.\n") ('If this is intended, avoid the warning with an empty first parameter.\n') 
                            ('If this is not intended, please specify the file wildcard.')
                          )
                        }
                      ]
                      redirects: [
                        (redir.Redir
                          op: (Token id:Id.Redir_GreatAnd val:'>&' span_id:287)
                          fd: -1
                          arg_word: {(2)}
                        )
                      ]
                    )
                  ]
                  spids: [258 273]
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:glob)
                  op: assign_op.Equal
                  rhs: {(DQ ($ Id.VSub_Number '$2'))}
                  spids: [294]
                )
              ]
            )
          ]
          spids: [230 243]
        )
        (if_arm
          cond: [
            (command.Sentence
              child: 
                (C {(Id.Lit_LBracket '[')} {($ Id.VSub_Pound '$#')} {(-eq)} {(3)} {(Id.Lit_RBracket ']')})
              terminator: (Token id:Id.Op_Semi val:';' span_id:310)
            )
          ]
          action: [
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:grep_options)
                  op: assign_op.Equal
                  rhs: {(DQ ($ Id.VSub_Number '$1'))}
                  spids: [315]
                )
              ]
            )
            (C {(shift)})
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:glob)
                  op: assign_op.Equal
                  rhs: {(DQ ($ Id.VSub_Number '$2'))}
                  spids: [324]
                )
              ]
            )
          ]
          spids: [299 312]
        )
      ]
    )
    (command.If
      arms: [
        (if_arm
          cond: [
            (command.Sentence
              child: 
                (command.Pipeline
                  children: [
                    (C {(printf)} {(DQ ('%s') (Id.Lit_Other '\\') (n))} 
                      {(DQ ($ Id.VSub_DollarName '$grep_options'))}
                    )
                    (command.Simple
                      words: [{(grep)} {(-E)} {(--)} {(DQ ('-([EFGP]|regexp|fixed)'))}]
                      redirects: [
                        (redir.Redir
                          op: (Token id:Id.Redir_Great val:'>' span_id:364)
                          fd: -1
                          arg_word: {(/dev/null)}
                        )
                        (redir.Redir
                          op: (Token id:Id.Redir_GreatAnd val:'2>&' span_id:367)
                          fd: 2
                          arg_word: {(1)}
                        )
                      ]
                    )
                  ]
                  negated: T
                )
              terminator: (Token id:Id.Op_Semi val:';' span_id:369)
            )
          ]
          action: [
            (command.AndOr
              ops: [Id.Op_DAmp Id.Op_DPipe]
              children: [
                (command.Pipeline
                  children: [
                    (C {(echo)} {(DQ ($ Id.VSub_Number '$1'))})
                    (command.Simple
                      words: [{(grep)} {(SQ (Token id:Id.Lit_Chars val:'[.[\\()*+?{|^$]' span_id:389))}]
                      redirects: [
                        (redir.Redir
                          op: (Token id:Id.Redir_Great val:'>' span_id:392)
                          fd: -1
                          arg_word: {(/dev/null)}
                        )
                      ]
                    )
                  ]
                  negated: F
                )
                (command.ShAssignment
                  pairs: [
                    (assign_pair
                      lhs: (sh_lhs_expr.Name name:type)
                      op: assign_op.Equal
                      rhs: {(DQ (-E))}
                      spids: [397]
                    )
                  ]
                )
                (command.ShAssignment
                  pairs: [
                    (assign_pair
                      lhs: (sh_lhs_expr.Name name:type)
                      op: assign_op.Equal
                      rhs: {(DQ (-F))}
                      spids: [404]
                    )
                  ]
                )
              ]
            )
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:grep_options)
                  op: assign_op.Equal
                  rhs: 
                    {(DQ ($ Id.VSub_DollarName '$grep_options') (' ') ($ Id.VSub_DollarName '$type'))}
                  spids: [410]
                )
              ]
            )
          ]
          spids: [335 371]
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:repodirs)
          op: assign_op.Equal
          rhs: {(DQ ('.git .svn CVS .hg .bzr _darcs'))}
          spids: [420]
        )
      ]
    )
    (command.ForEach
      iter_name: dir
      iter_words: [{($ Id.VSub_DollarName '$repodirs')}]
      do_arg_iter: F
      body: 
        (command.DoGroup
          children: [
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:repo_ign)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (DQ ($ Id.VSub_DollarName '$repo_ign') 
                        (braced_var_sub
                          token: (Token id:Id.VSub_Name val:repo_ign span_id:441)
                          suffix_op: (suffix_op.Unary op_id:Id.VTest_Plus arg_word:{(DQ (' -o '))})
                        ) ('-name ') ($ Id.VSub_DollarName '$dir')
                      )
                    }
                  spids: [437]
                )
              ]
            )
          ]
        )
    )
    (command.Pipeline
      children: [
        (C {(find)} {(.)} 
          {(word_part.EscapedLiteral token:(Token id:Id.Lit_EscapedChar val:'\\(' span_id:458))} {(-type)} {(d)} {(-a)} 
          {(word_part.EscapedLiteral token:(Token id:Id.Lit_EscapedChar val:'\\(' span_id:466))} {($ Id.VSub_DollarName '$repo_ign')} 
          {(word_part.EscapedLiteral token:(Token id:Id.Lit_EscapedChar val:'\\)' span_id:470))} {(word_part.EscapedLiteral token:(Token id:Id.Lit_EscapedChar val:'\\)' span_id:472))} {(-prune)} {(-o)} 
          {(word_part.EscapedLiteral token:(Token id:Id.Lit_EscapedChar val:'\\(' span_id:480))} {(-type)} {(f)} {(-name)} {(DQ ($ Id.VSub_DollarName '$glob'))} {(-print0)} 
          {(word_part.EscapedLiteral token:(Token id:Id.Lit_EscapedChar val:'\\)' span_id:494))}
        )
        (command.Simple
          words: [
            {(xargs)}
            {(-0)}
            {(grep)}
            {($ Id.VSub_DollarName '$colour')}
            {($ Id.VSub_DollarName '$grep_options')}
            {(--)}
            {(DQ ($ Id.VSub_Number '$1'))}
          ]
          more_env: [
            (env_pair name:GREP_COLOR val:{(DQ ('1;33;40'))} spids:[504])
            (env_pair name:LANG val:{(C)} spids:[509])
          ]
        )
      ]
      negated: F
    )
  ]
)