@task<EOL>@consume_args<EOL>def cog(options):
options.order('<STR_LIT>', '<STR_LIT>', add_rest=True)<EOL>files_to_cog = getattr(options, '<STR_LIT:args>', [])<EOL>if files_to_cog and os.path.isdir(files_to_cog[<NUM_LIT:0>]):<EOL><INDENT>dir_to_scan = path(files_to_cog[<NUM_LIT:0>])<EOL>files_to_cog = list(dir_to_scan.walkfiles(<EOL>options.get("<STR_LIT>", "<STR_LIT>")<EOL>))<EOL><DEDENT>try:<EOL><INDENT>_runcog(options, files_to_cog)<EOL><DEDENT>except Exception as err:<EOL><INDENT>print('<STR_LIT>' % err)<EOL>raise<EOL><DEDENT>return<EOL>
Run cog against all or a subset of the input source files.

    Examples::

      $ paver cog PyMOTW/atexit
      $ paver cog PyMOTW/atexit/index.rst
      $ paver cog

    See help on paver.doctools.cog for details on the standard
    options.