Coverage for mfplugin/cli_tools/plugins_hash.py: 0%
14 statements
« prev ^ index » next coverage.py v7.6.1, created at 2024-11-13 15:57 +0000
« prev ^ index » next coverage.py v7.6.1, created at 2024-11-13 15:57 +0000
1#!/usr/bin/env python3
3import argparse
4import sys
5from mfplugin.compat import get_plugin_hash
7DESCRIPTION = "get a hash of a plugin"
10def main():
11 arg_parser = argparse.ArgumentParser(description=DESCRIPTION)
12 arg_parser.add_argument("name_or_filepath", type=str,
13 help="installed plugin name (without version) or "
14 "full plugin filepath")
15 args = arg_parser.parse_args()
17 hsh = get_plugin_hash(args.name_or_filepath)
18 if hsh is None:
19 sys.exit(1)
20 print(hsh)
23if __name__ == '__main__':
24 main()