()
| 5 | |
| 6 | |
| 7 | def main(): |
| 8 | if len(sys.argv[1:]) != 1: |
| 9 | sys.stderr.write('%s: exactly one argument expected.\n' % sys.argv[0]) |
| 10 | sys.exit(1) |
| 11 | |
| 12 | env.init_no_state() |
| 13 | logs.setup( |
| 14 | tty=sys.stderr, parent_logs=env.v.LOG, |
| 15 | pretty=env.v.PRETTY, color=env.v.COLOR) |
| 16 | |
| 17 | want = sys.argv[1] |
| 18 | if not want: |
| 19 | err('cannot build the empty target ("").\n') |
| 20 | sys.exit(204) |
| 21 | |
| 22 | abswant = os.path.abspath(want) |
| 23 | pdf = paths.possible_do_files(abswant) |
| 24 | for dodir, dofile, basedir, basename, ext in pdf: |
| 25 | dopath = os.path.join('/', dodir, dofile) |
| 26 | relpath = os.path.relpath(dopath, '.') |
| 27 | exists = os.path.exists(dopath) |
| 28 | assert '\n' not in relpath |
| 29 | print relpath |
| 30 | if exists: |
| 31 | sys.exit(0) |
| 32 | sys.exit(1) # no appropriate dofile found |
| 33 | |
| 34 | |
| 35 | if __name__ == '__main__': |
no test coverage detected