Showing the changes to python/scripts (1 of 1 file). Show all
Unified · Split
| @@ -114,8 +114,12 @@ def parse_args(): · 113 unmodified lines | ||
| 114 | 114 | help="be quiet") |
| 115 | 115 | (options, args) = parser.parse_args() |
| 116 | 116 | if not options.source_file: |
| 117 | − print "no file name given\n", usage | |
| 118 | − sys.exit(1) | |
| 117 | + import os.path | |
| 118 | + if len(args) == 1: | |
| 119 | + options.source_file = args[0] | |
| 120 | + else: | |
| 121 | + print "no file name given\n", usage | |
| 122 | + sys.exit(1) | |
| 119 | 123 | return options, args |
| 120 | 124 | |
| 121 | 125 | if __name__ == '__main__': |