#!/usr/bin/env python3
import os
import argparse

def get_arguments():
    parser = argparse.ArgumentParser()

    # argument groups can have their tickers combined (ie -su)
    bools = parser.add_argument_group()

    parser.add_argument('repo_name', help="The name of the repo created on git")

    parser.add_argument('-u', '--username', default="slgotting",
                        help="the github username you are cloning from")

    bools.add_argument('-nr', dest="no_recurse_submodules", action="store_false",
                       help="if ticked then we don't recurse submodules; default is to recurse.")

    args = parser.parse_args()

    return args



if __name__ == "__main__":
    args = get_arguments()
    print(args)

    if not no_recurse_submodules:
        os.system(f"git clone --recurse-submodules git@github.com:{args.username}/{args.repo_name}.git")
        
    else:
        os.system(f"git clone git@github.com:{args.username}/{args.repo_name}.git")
        
