Add finish_release.py CLI parsing and flags
diff --git a/tools/finish_release.py b/tools/finish_release.py
index bc8e832dfb7..24e20987fa9 100755
--- a/tools/finish_release.py
+++ b/tools/finish_release.py
@@ -21,6 +21,7 @@
 python tools/finish_release.py ~/.ssh/githubpat.txt
 """
 
+import argparse
 import glob
 import os.path
 import re
@@ -44,6 +45,34 @@
 # for sanity checking.
 SNAP_ARCH_COUNT = 3
 
+
+def parse_args(args):
+    """Parse command line arguments.
+
+    :param args: command line arguments with the program name removed. This is
+        usually taken from sys.argv[1:].
+    :type args: `list` of `str`
+
+    :returns: parsed arguments
+    :rtype: argparse.Namespace
+
+    """
+    # Use the file's docstring for the help text and don't let argparse reformat it.
+    parser = argparse.ArgumentParser(description=__doc__,
+                                     formatter_class=argparse.RawDescriptionHelpFormatter)
+    parser.add_argument('githubpat', help='path to your GitHub personal access token')
+    group = parser.add_mutually_exclusive_group()
+    # We use 'store_false' and a destination related to the other type of
+    # artifact to cause the flag being set to disable publishing of the other
+    # artifact. This makes using the parsed arguments later on a little simpler
+    # and cleaner.
+    group.add_argument('--snaps-only', action='store_false', dest='publish_windows',
+                        help='Skip publishing other artifacts and only publish the snaps')
+    group.add_argument('--windows-only', action='store_false', dest='publish_snaps',
+                        help='Skip publishing other artifacts and only publish the Windows installer')
+    return parser.parse_args(args)
+
+
 def download_azure_artifacts(tempdir):
     """Download and unzip build artifacts from Azure pipelines.
 
@@ -181,8 +210,9 @@ def promote_snaps(version):
 
 
 def main(args):
-    github_access_token_file = args[0]
+    parsed_args = parse_args(args)
 
+    github_access_token_file = parsed_args.githubpat
     github_access_token = open(github_access_token_file, 'r').read().rstrip()
 
     with tempfile.TemporaryDirectory() as tempdir:
@@ -191,8 +221,10 @@ def main(args):
         # again fails. Publishing the snaps can be done multiple times though
         # so we do that first to make it easier to run the script again later
         # if something goes wrong.
-        promote_snaps(version)
-        create_github_release(github_access_token, tempdir, version)
+        if parsed_args.publish_snaps:
+            promote_snaps(version)
+        if parsed_args.publish_windows:
+            create_github_release(github_access_token, tempdir, version)
 
 if __name__ == "__main__":
     main(sys.argv[1:])

We were recently notified that https://ubuntu.com/security/notices/USN-4662-1 is affecting our snaps. I'm rebuilding them, but once that's done, I need to publish them by running `tools/finish_release.py`. I don't want to republish the Windows installer though. I could modify the code, but I think some command line options for this is nicer.

I tested that the four combinations of the `--*-only` flags works as expected and the `--help` output looks like:
```
usage: finish_release.py [-h] [--snaps-only | --windows-only] githubpat

Post-release script to publish artifacts created from Azure Pipelines.

This currently includes:

* Moving snaps from the beta channel to the stable channel
* Publishing the Windows installer in a GitHub release

Setup:
 - Create a github personal access token
   - https://docs.github.com/en/github/authenticating-to-github/creating-a-personal-access-token#creating-a-token
   - You'll need repo scope
   - Save the token to somewhere like ~/.ssh/githubpat.txt
 - Install the snapcraft command line tool and log in to a privileged account.
   - https://snapcraft.io/docs/installing-snapcraft
   - Use the command `snapcraft login` to log in.

Run:

python tools/finish_release.py ~/.ssh/githubpat.txt

positional arguments:
  githubpat       path to your GitHub personal access token

optional arguments:
  -h, --help      show this help message and exit
  --snaps-only    Skip publishing other artifacts and only publish the snaps
  --windows-only  Skip publishing other artifacts and only publish the Windows installer
```
@ohemorange, since you and are the ones using this script, I think it makes the most sense for you to review it when you get a chance.