#!/usr/bin/env python3

import pathlib
import sys

ROOT = pathlib.Path(__file__).parent
sys.path.insert(0, str(ROOT))

from code2flow.engine import code2flow


def main():
  if (len(sys.argv) < 2):
    print("\n --Either input package name or output file name is missing!\n")
    exit(0)
  if not pathlib.Path(sys.argv[1]).exists():
    print("\n --Input package (path) does not exist!\n")
    exit(0) 
  code2flow(sys.argv[:-1], sys.argv[-1])


if __name__ == "__main__":
  main()
