def parseargs(parser):
 (options, args) = parser.parse_args()
 filenames = [arg for arg in args if arg.endswith('.py')]
 if filenames:
  if (len(filenames) > 1):
   parser.error('only one filename is acceptable')
  explicitfile = filenames[0]
  args.remove(explicitfile)
 else:
  explicitfile = None
 testlib.ENABLE_DBC = options.dbc
 newargs = parser.newargs
 if options.skipped:
  newargs.extend(['--skip', options.skipped])
 if options.restart:
  options.exitfirst = True
 newargs += args
 return (options, explicitfile)

def parseargs ( parser ) : ( options , args ) = parser . parse_args ( ) filenames = [ arg for arg in args if arg . endswith ( '.py' ) ] if filenames : if ( len ( filenames ) > 1 ) : parser . error ( 'only one filename is acceptable' ) explicitfile = filenames [ 0 ] args . remove ( explicitfile ) else : explicitfile = None testlib . ENABLE_DBC = options . dbc newargs = parser . newargs if options . skipped : newargs . extend ( [ '--skip' , options . skipped ] ) if options . restart : options . exitfirst = True newargs += args return ( options , explicitfile )
parse the command line and return .