|
14 | 14 | -o file |
15 | 15 | --output-file=file |
16 | 16 | Specify the output file to write to. If omitted, output will go to a |
17 | | - file named filename.mo (based off the input file name). |
| 17 | + file named filename.mo (based off the input file name(s)). |
| 18 | + If more than one input file is given, and if an output file is passed |
| 19 | + with -o option, then all the input files are merged. If keys are |
| 20 | + repeated (common for "" key for the header) the one from last file is used. |
| 21 | + If more than one input file is given, and no -o option is present, then |
| 22 | + every input file is compiled in its corresponding mo file (same name |
| 23 | + with mo replacing po) |
18 | 24 |
|
19 | 25 | -h |
20 | 26 | --help |
|
23 | 29 | -V |
24 | 30 | --version |
25 | 31 | Display version information and exit. |
26 | | -
|
27 | | -If more than one input file is given, and if an output file is passed with |
28 | | --o option, then all the input files are merged. If keys are repeated (common |
29 | | -for "" key for the header) the one from last file is used. |
30 | | -
|
31 | | -If more than one input file is given, and no -o option is present, then |
32 | | -every input file is compiled in its corresponding mo file (same name with mo |
33 | | -replacing po) |
34 | 32 | """ |
35 | 33 |
|
36 | 34 | import os |
@@ -255,9 +253,9 @@ def writefile(outfile, output): |
255 | 253 | print(msg, file=sys.stderr) |
256 | 254 |
|
257 | 255 |
|
258 | | -def main(argv): |
| 256 | +def main(): |
259 | 257 | try: |
260 | | - opts, args = getopt.getopt(argv, 'hVo:', |
| 258 | + opts, args = getopt.getopt(sys.argv[1:], 'hVo:', |
261 | 259 | ['help', 'version', 'output-file=']) |
262 | 260 | except getopt.error as msg: |
263 | 261 | usage(1, msg) |
@@ -285,4 +283,4 @@ def main(argv): |
285 | 283 |
|
286 | 284 |
|
287 | 285 | if __name__ == '__main__': |
288 | | - main(sys.argv[1:]) |
| 286 | + main() |
0 commit comments