Fixed a lot of issues

This commit is contained in:
Firq 2024-10-04 20:18:56 +02:00
parent fdc62c04a6
commit 3d546df0e0
Signed by: Firq
GPG key ID: 3ACC61C8CEC83C20
9 changed files with 83 additions and 71 deletions
atlasimagecomposer/cli

View file

View file

@ -0,0 +1,45 @@
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()