<s> """<STR_LIT>""" <EOL> from sys import argv <EOL> import os <EOL> try : <EOL> from robot import run_cli <EOL> except : <EOL> print >> sys . stderr , "<STR_LIT>" <EOL> exit ( <NUM_LIT:1> ) <EOL> from robot . api import logger <EOL> testsuites_path = "<STR_LIT>" % ( os . path . dirname ( argv [ <NUM_LIT:0> ] ) , "<STR_LIT>" ) <EOL> if len ( argv ) == <NUM_LIT:1> : <EOL> logger . warn ( "<STR_LIT>" ) <EOL> argv . append ( testsuites_path ) <EOL> run_cli ( argv [ <NUM_LIT:1> : ] ) <EOL> exit ( <NUM_LIT:0> ) <EOL> if set . intersection ( set ( [ "<STR_LIT>" , "<STR_LIT>" ] ) , set ( argv ) ) : <EOL> logger . warn ( "<STR_LIT>" ) <EOL> exit ( <NUM_LIT:1> ) <EOL> position = None <EOL> for i in xrange ( len ( argv [ <NUM_LIT:1> : ] ) ) : <EOL> arg = argv [ i ] <EOL> if arg [ : <NUM_LIT:1> ] != "<STR_LIT:->" and arg [ : <NUM_LIT:2> ] != "<STR_LIT>" : <EOL> if i == <NUM_LIT:0> : <EOL> position = <NUM_LIT:1> <EOL> break <EOL> else : <EOL> arg_before = argv [ i - <NUM_LIT:1> ] <EOL> if arg_before [ : <NUM_LIT:1> ] != "<STR_LIT:->" and arg_before [ : <NUM_LIT:2> ] != "<STR_LIT>" : <EOL> position = i <EOL> break <EOL> common = os . path . commonprefix ( [ testsuites_path , argv [ position ] ] ) <EOL> child_suite = None <EOL> if common : <EOL> child_suite = argv [ position ] . split ( common ) [ <NUM_LIT:1> ] <EOL> if child_suite : <EOL> argv [ position ] = child_suite <EOL> argv = argv [ : position ] + [ "<STR_LIT>" ] + argv [ position : ] <EOL> argv . append ( testsuites_path ) <EOL> run_cli ( argv [ <NUM_LIT:1> : ] ) </s>
