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

Function cli

ci/util/tools.py:125–206  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

123
124
125def cli() -> None:
126 import argparse
127
128 parser = argparse.ArgumentParser(
129 description="Dump object file information using build tools"
130 )
131
132 parser.add_argument(
133 "build_path",
134 type=Path,
135 nargs="?",
136 help="Path to build directory containing build info JSON file",
137 )
138
139 parser.add_argument(
140 "--symbols", action="store_true", help="Dump symbol table using nm"
141 )
142 parser.add_argument(
143 "--disassemble", action="store_true", help="Dump disassembly using objdump"
144 )
145
146 args = parser.parse_args()
147 build_path = args.build_path
148 symbols = args.symbols
149 disassemble = args.disassemble
150
151 # Check if object file was provided and exists
152 if build_path is None:
153 build_path = _prompt_build()
154 else:
155 if not _check_build(build_path):
156 print("Error: Invalid build directory", file=sys.stderr)
157 sys.exit(1)
158
159 assert build_path is not None
160 assert build_path
161
162 build_info_path = build_path / "build_info.json"
163 assert build_info_path.exists(), f"File not found: {build_info_path}"
164
165 tools = load_tools(build_info_path)
166
167 if not symbols and not disassemble:
168 while True:
169 print(
170 "Error: Please specify at least one action to perform", file=sys.stderr
171 )
172 action = input(
173 "Enter 's' to dump symbols, 'd' to disassemble, or 'q' to quit: "
174 )
175 if action == "s":
176 symbols = True
177 break
178 elif action == "d":
179 disassemble = True
180 break
181 elif action == "q":
182 sys.exit(0)

Callers 15

tools.pyFile · 0.70
millisFunction · 0.50
microsFunction · 0.50
clockless_avr.hFile · 0.50
interruptsDisableFunction · 0.50
attach_timer_handlerFunction · 0.50
detach_handlerFunction · 0.50
enable_handlerFunction · 0.50
disable_handlerFunction · 0.50
showPixelsMethod · 0.50

Calls 7

load_toolsFunction · 0.85
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