"// Copyright (c) FIRST and other WPILib contributors.\n// Open Source Software; you can modify and/or share it under the terms of\n// the WPILib BSD license file in the root directory of this project.\n"
+content,
encoding="utf-8",
newline="\n",
)
defmain():
script_path=Path(__file__).resolve()
dirname=script_path.parent
root_path=dirname.parent
nanopb_path=os.path.join(
root_path,
"wpiutil",
"src",
"main",
"native",
"thirdparty",
"nanopb",
"generator",
"nanopb_generator.py",
)
parser=argparse.ArgumentParser()
parser.add_argument(
"--nanopb",
help="Nanopb generator command",
default=nanopb_path,
)
parser.add_argument(
"--output_directory",
help="Optional. If set, will output the generated files to this directory, otherwise it will use a path relative to the script",