#!/usr/bin/env python3

from argparse import ArgumentParser, REMAINDER
from os import getcwd, path
from subprocess import call

argparse = ArgumentParser(description = "Project 128 - Project Manager")

proj128_version = "1.5.1"
argparse.add_argument("-v", "--version", action = "version", version = proj128_version)

argparse.add_argument("-p", "--project", default = getcwd(), help = "folder the project lies in (default: working directory)")

argparse.add_argument("task", help = "task to execute")
argparse.add_argument("args", help = "arguments to execute the task with", nargs = REMAINDER)

args = argparse.parse_args()

exit(call([
    path.realpath(path.dirname(path.realpath(__file__)) + "/../cli/proj128"),
    path.realpath(args.project),
    args.task
] + args.args))
