OLD | NEW |
(Empty) | |
| 1 #!/usr/bin/env python |
| 2 # Copyright 2015 The Chromium Authors. All rights reserved. |
| 3 # Use of this source code is governed by a BSD-style license that can be |
| 4 # found in the LICENSE file. |
| 5 |
| 6 import shutil |
| 7 import sys |
| 8 |
| 9 def usage(): |
| 10 print """\nUsage: %s <input_files> <output_files> |
| 11 |
| 12 Copies 1 or 2 <input_files> to matching <output_files> |
| 13 |
| 14 Examples: |
| 15 Copy 1 file: |
| 16 ./copy_with_rename.py in out |
| 17 Copy 2 files: |
| 18 ./copy_with_rename.py in1 in2 out1 out2 |
| 19 """ % sys.argv[0] |
| 20 sys.exit(1) |
| 21 |
| 22 |
| 23 def Main(argv): |
| 24 if len(argv) == 3: |
| 25 shutil.copyfile(argv[1], argv[2]) |
| 26 elif len(argv) == 5: |
| 27 shutil.copyfile(argv[1], argv[3]) |
| 28 shutil.copyfile(argv[2], argv[4]) |
| 29 else: |
| 30 usage() |
| 31 return 0 |
| 32 |
| 33 |
| 34 if __name__ == '__main__': |
| 35 sys.exit(Main(sys.argv)) |
OLD | NEW |