docs: def cli_sign_jar(argument_list=None):
      """
      Command-line wrapper around sign()
      """
  
      usage_message = "jarutil s [OPTIONS] jar_file cert_file " \
                      "key_file key_alias"
  
      parser = argparse.ArgumentParser(usage=usage_message)
  
      parser.add_argument("jar_file", type=str,
                          help="JAR file to sign")
      parser.add_argument("cert_file", type=str,
                          help="Certificate file (PEM format)")
      parser.add_argument("key_file", type=str,
                          help="Private key file (PEM format)")
      parser.add_argument("key_alias", type=str,
                          help="JAR \"key alias\" to use")
  
      parser.add_argument("-d", "--digest", action="store", default="SHA-256",
                          # TODO: factor to a constant
                          help="Digest algorithm used for signing")
  
      parser.add_argument("-c", "--chain", action="append",
                          dest="extra_certs", default=[],
                          help="Additional certificates to embed into the"
                          " signature (PEM format). More than one \"-c\" option"
                          " can be provided.")
  
      parser.add_argument("-o", "--output", action="store", default=None,
                          help="Filename to put signed jar. If not provided, the"
                          " signature is added to the original jar file.")
  
      args = parser.parse_args(argument_list)
  
      try:
          sign(args.jar_file, args.cert_file, args.key_file, args.key_alias,
               args.extra_certs, args.digest, args.output)
  
      except CannotFindKeyTypeError:
          print("Cannot determine private key type in %s" % args.key_file)
          return 1
  
      except MissingManifestError:
          print("Manifest missing in jar file %s" % args.jar_file)
          return 2
  
      return 0