46 lines
1.4 KiB
Python
46 lines
1.4 KiB
Python
import argparse
|
|
import pathlib
|
|
import sys
|
|
|
|
from .. import __version__
|
|
from ..backend import compose
|
|
from ..config import Paths
|
|
|
|
|
|
# pylint: disable=too-few-public-methods
|
|
class Arguments(argparse.Namespace):
|
|
"""
|
|
Default Arguments when calling the CLI
|
|
"""
|
|
output: str
|
|
|
|
def parse_arguments():
|
|
"""
|
|
Create a parser and parse the arguments of sys.argv based on the Arguments Namespace
|
|
Returns arguments and extra arguments separately
|
|
"""
|
|
parser = argparse.ArgumentParser(
|
|
prog="atlasimagecomposer",
|
|
description="CLI tool to automatically generate expression sheets for servants",)
|
|
|
|
parser.add_argument("--output", action="store", type=str, default=None, dest="output", help="Set the output location. This can be an absolute or relative path")
|
|
parser.add_argument("--version", action="version", version=f"atlasimagecomposer {__version__}")
|
|
|
|
args = Arguments()
|
|
args, extra_args = parser.parse_known_args(sys.argv[1:], namespace=args)
|
|
return args, extra_args
|
|
|
|
def welcome():
|
|
print("-------------------------------------------------")
|
|
print(" Welcome to the FGO Sprite loader and composer ")
|
|
print(" developed by Firq ")
|
|
print("-------------------------------------------------")
|
|
|
|
def run():
|
|
args, _ = parse_arguments()
|
|
if args.output:
|
|
Paths.OUTPUT = pathlib.Path(args.output)
|
|
|
|
welcome()
|
|
compose()
|