def verify_ed25519_signature_cmdln(args=None, exception=SystemExit):
    """Verify an ed25519 signature from the command line.

    Args:
        args (list, optional): the commandline args to parse. If ``None``, use
            ``sys.argv[1:]``. Defaults to ``None``.
        exception (Exception, optional): the exception to raise on failure.
            Defaults to ``SystemExit``.

    """
    args = args or sys.argv[1:]
    parser = argparse.ArgumentParser(
        description="""Verify an ed25519 signature from the command line.

Given a file and its detached signature, verify that it has been signed with
a valid key. This key can be specified on the command line; otherwise we'll
default to ``config['ed25519_public_keys']``.""")
    parser.add_argument('--pubkey', help='path to a base64-encoded ed25519 pubkey, optional')
    parser.add_argument('file_path')
    parser.add_argument('sig_path')
    opts = parser.parse_args(args)
    log = logging.getLogger('scriptworker')
    log.setLevel(logging.DEBUG)
    logging.basicConfig()
    pubkeys = {}
    if opts.pubkey:
        pubkeys['cmdln'] = [read_from_file(opts.pubkey)]
    pubkeys.update(dict(DEFAULT_CONFIG['ed25519_public_keys']))
    contents = read_from_file(opts.file_path, file_type='binary')
    signature = read_from_file(opts.sig_path, file_type='binary')
    for key_type, seeds in pubkeys.items():
        for seed in seeds:
            try:
                verify_ed25519_signature(
                    ed25519_public_key_from_string(seed), contents, signature,
                    "didn't work with {}".format(seed)
                )
                log.info("Verified good with {} seed {} !".format(
                    key_type, seed
                ))
                sys.exit(0)
            except ScriptWorkerEd25519Error:
                pass
    raise exception("This is not a valid signature!")
Verify an ed25519 signature from the command line.

    Args:
        args (list, optional): the commandline args to parse. If ``None``, use
            ``sys.argv[1:]``. Defaults to ``None``.
        exception (Exception, optional): the exception to raise on failure.
            Defaults to ``SystemExit``.