2022-02-04 13:54:10 +00:00
|
|
|
#!/usr/bin/env python3
|
|
|
|
|
|
|
|
import argparse
|
|
|
|
|
2022-02-07 10:44:16 +00:00
|
|
|
from .commands.genhtml_command import GenHTMLCommand, add_genhtml_command, get_genhtml_args
|
2022-02-06 15:20:12 +00:00
|
|
|
from .commands.process_command import ProcessCommand, add_process_command, get_process_args
|
|
|
|
from .commands.copy_command import CopyCommand, add_copy_command, get_copy_args
|
|
|
|
from .commands.transcode_command import TranscodeCommand, add_transcode_command, get_transcode_args
|
2022-02-04 13:54:10 +00:00
|
|
|
|
2022-02-07 11:12:40 +00:00
|
|
|
def main():
|
|
|
|
parser = argparse.ArgumentParser(
|
|
|
|
description="chaos's musicutil")
|
|
|
|
subparsers = parser.add_subparsers(dest="subparser_name")
|
2022-02-07 10:44:16 +00:00
|
|
|
|
2022-02-07 11:12:40 +00:00
|
|
|
add_copy_command(subparsers)
|
|
|
|
add_process_command(subparsers)
|
|
|
|
add_transcode_command(subparsers)
|
|
|
|
add_genhtml_command(subparsers)
|
2022-02-04 13:54:10 +00:00
|
|
|
|
2022-02-07 11:12:40 +00:00
|
|
|
args = parser.parse_args()
|
2022-02-04 16:19:11 +00:00
|
|
|
|
2022-02-07 11:12:40 +00:00
|
|
|
if args.subparser_name == "process":
|
|
|
|
ProcessCommand(get_process_args(args)).run()
|
|
|
|
elif args.subparser_name == "copy":
|
|
|
|
CopyCommand(get_copy_args(args)).run()
|
|
|
|
elif args.subparser_name == "transcode":
|
|
|
|
TranscodeCommand(get_transcode_args(args)).run()
|
|
|
|
elif args.subparser_name == "genhtml":
|
|
|
|
GenHTMLCommand(get_genhtml_args(args)).run()
|
2022-02-08 12:07:24 +00:00
|
|
|
else:
|
|
|
|
parser.print_help()
|
2022-02-04 13:54:10 +00:00
|
|
|
|
2022-02-07 11:12:40 +00:00
|
|
|
if __name__ == "__main__":
|
|
|
|
main()
|