#!/usr/bin/env python3
import os
import sys

# Emulate the behaviour of --version to help with testing.
if len(sys.argv) > 1 and sys.argv[1] == "--version":
    # Check the test specific environment variable to determine whether to
    # present Quartus Pro or Quartus Std information
    if os.getenv("FUSESOC_QUARTUS_EDITION", "Standard") == "Pro":
        print("Version 17.1.2 Build 304 01/31/2018 SJ Pro Edition")
    else:
        print("Version 16.1.2 Build 203 01/18/2017 SJ Standard Edition")
    sys.exit(0)

with open("quartus_sh.cmd", "w") as f:
    f.write(" ".join(sys.argv[1:]) + "\n")
