main

The standard entry point to this script.

This script will exit with a numeric error statement.  The following are
possible:
    errno.<POSIX> - Please look to the debugging messages and the meaning to
        The standard UNIX/LINUX POSIX meanings
    -1 - An unpredictable error has occurred.  Any number of problems may
        have happened; however, all of them were not predicted by the
        developer.  This is a bug that has been detected.
    0 - Execution, as far as the program is concerned, is complete and has
        been completed successfully.  Any errors that may have resulted,
        resulted without the program's knowledge and was the result of an
        error outside of the developer's ability to predict.

def main():
    """main

The standard entry point to this script.

This script will exit with a numeric error statement.  The following are
possible:
    errno.<POSIX> - Please look to the debugging messages and the meaning to
        The standard UNIX/LINUX POSIX meanings
    -1 - An unpredictable error has occurred.  Any number of problems may
        have happened; however, all of them were not predicted by the
        developer.  This is a bug that has been detected.
    0 - Execution, as far as the program is concerned, is complete and has
        been completed successfully.  Any errors that may have resulted,
        resulted without the program's knowledge and was the result of an
        error outside of the developer's ability to predict.
    """
    flagged_args = get_flagged_args()
    working = os.getcwd()
    config = load_json()
    errnum = 0
    error = _preliminary_construct(config)
    if not error and flagged_args:
        error = handle_flagged_args(flagged_args, config)
    elif not error:
        get_args()
        error = build_packages(config)
    error = test_packages(config)
    os.chdir(working)  # no matter where we were... return.
    if error:
        errnum = error.errnum
    return errnum