The code would boil down to this:

```
git_opts.add_option(
          '--git-protocol', default='https', dest='git_protocol',
          help="Use a specific git protocol to download dependencies. "
               "Supported protocols: {0}".format(git_protocols))
```

and code

```
if conf.options.git_protocol not in git_protocols:
    conf.fatal(message: unsupported protocol)
else:
    global git_protocol_handler = conf.options.git_protocol
```