Milestone 6: webgc part 3

21 April 2019   PDF version

Using the argparse module, create an argument parser in webgc/main.py that can support the following arguments:

  • --help (-h) this should be generated automatically, but test it to make sure it works and the output is reasonable.
  • --version (-V) would print out some version, copyright, authorship information.
  • --quiet (-q) and --verbose (-v) are opposites – the former should decrement a verbosity level, while the latter increments it. The resulting integer will be used to determine which types of messages to output.
  • --force (-f) will indicate that the tool should proceed with the dangerous operation of deleting garbage files. (Without this, it will just print the garbage files.)
  • --dir (-d) takes one argument which should be a directory to serve as the root of the web site.
  • Any remaining arguments would represent files within the specified directory that serve as roots for garbage collection.

For this milestone, you just need to construct the argument parser; the tool as a whole does not need to support all these features yet.