MCPcopy Create free account
hub / github.com/FastLED/FastLED / cli

Function cli

ci/inspect_obj.py:76–116  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

74
75
76def cli() -> None:
77 import argparse
78
79 parser = argparse.ArgumentParser(
80 description="Dump object file information using build tools"
81 )
82
83 parser.add_argument(
84 "build_path",
85 type=Path,
86 nargs="?",
87 help="Path to build directory containing build info JSON file",
88 )
89
90 args = parser.parse_args()
91 build_path = args.build_path
92
93 # Check if object file was provided and exists
94 if build_path is None:
95 build_path = _prompt_build()
96 else:
97 if not _check_build(build_path):
98 print("Error: Invalid build directory", file=sys.stderr)
99 sys.exit(1)
100
101 assert build_path is not None
102 assert build_path
103
104 build_info_path = build_path / "build_info.json"
105 assert build_info_path.exists(), f"File not found: {build_info_path}"
106
107 tools = load_tools(build_info_path)
108
109 object_file = _prompt_object_file(build_path)
110
111 cmd = [str(tools.objdump_path), "--syms", str(object_file)]
112 if sys.platform == "win32":
113 cmd = ["cmd", "/c"] + cmd
114 cmd_str = subprocess.list2cmdline(cmd)
115 subprocess.run(cmd, check=True)
116 print("\nDone. Command used:", cmd_str)
117
118
119if __name__ == "__main__":

Callers 1

inspect_obj.pyFile · 0.70

Calls 7

load_toolsFunction · 0.90
parse_argsMethod · 0.80
_prompt_buildFunction · 0.70
_check_buildFunction · 0.70
_prompt_object_fileFunction · 0.70
printFunction · 0.50
runMethod · 0.45

Tested by

no test coverage detected