File: cli.py

package info (click to toggle)
pytest-salt-factories 0.121.1-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 1,068 kB
  • sloc: python: 9,193; makefile: 15
file content (22 lines) | stat: -rw-r--r-- 617 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import argparse
import sys

import saltfactories


def main():
    parser = argparse.ArgumentParser(description="PyTest Salt Factories")
    parser.add_argument(
        "--coverage",
        action="store_true",
        help="Prints the path to where the sitecustomize.py is to trigger coverage tracking on sub-processes.",
    )
    options = parser.parse_args()
    if options.coverage:
        print(str(saltfactories.CODE_ROOT_DIR / "utils" / "coverage"), file=sys.stdout, flush=True)
        parser.exit(status=0)
    parser.exit(status=1, message=parser.format_usage())


if __name__ == "__main__":
    main()