25 lines
672 B
Python
Executable File
25 lines
672 B
Python
Executable File
#!/usr/bin/env python3
|
|
|
|
import argparse
|
|
import convert_file_encoding
|
|
|
|
if __name__ == "__main__":
|
|
top_parser = argparse.ArgumentParser()
|
|
subparsers = top_parser.add_subparsers()
|
|
|
|
parser = subparsers.add_parser(
|
|
'convert',
|
|
description='Recursively convert .cue and .log files from cp1251 to utf-8',
|
|
epilog='Example: python convert_encoding.py /path/to/directory'
|
|
)
|
|
parser.add_argument(
|
|
'directory',
|
|
type=str,
|
|
help='Path to target directory for conversion'
|
|
)
|
|
parser.set_defaults(func=convert_file_encoding.execute)
|
|
|
|
args = top_parser.parse_args()
|
|
print(args)
|
|
args.func(args)
|
|
|