Fixed a lot of issues
This commit is contained in:
parent
fdc62c04a6
commit
3d546df0e0
9 changed files with 83 additions and 71 deletions
atlasimagecomposer/cli
0
atlasimagecomposer/cli/__init__.py
Normal file
0
atlasimagecomposer/cli/__init__.py
Normal file
45
atlasimagecomposer/cli/cli.py
Normal file
45
atlasimagecomposer/cli/cli.py
Normal 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()
|
Loading…
Add table
Add a link
Reference in a new issue