Last time we had created cmd_init(args) function. We add more functionality to cmd_init(args).
This was our code till last time.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 import sys import argparse argparser = argparse.ArgumentParser(description="Another Content Tracker") argsubparsers = argparser.add_subparsers(title="Commands", dest="command") argsubparsers.required = True argsp = argsubparsers.add_parser("init", help="Initialize a new, empty repository.") argsp.add_argument("path", metavar="directory", nargs="?", default=".", help="Where to create the repository.