skyeweave/atlasimagecomposer/cli/cli.py
Firq 3d546df0e0
Some checks failed
/ pylint (push) Successful in 3m13s
/ mypy (push) Has been cancelled
/ lint-and-typing (push) Failing after 4m57s
/ publish-artifacts (push) Has been skipped
/ build-artifacts (push) Has been skipped
/ release (push) Successful in 1m43s
Fixed a lot of issues
2024-10-04 20:18:56 +02:00

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()