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

Function _parse_args_and_build_commands

ci/autoresearch/phases.py:171–715  ·  view source on GitHub ↗

Parse CLI args, validate modes, build JSON-RPC command list. Pure computation — no hardware I/O. Returns RunContext on success, int exit code on validation failure.

(args: Args)

Source from the content-addressed store, hash-verified

169
170
171def _parse_args_and_build_commands(args: Args) -> RunContext | int:
172 """Parse CLI args, validate modes, build JSON-RPC command list.
173
174 Pure computation — no hardware I/O.
175 Returns RunContext on success, int exit code on validation failure.
176 """
177 final_environment = args.environment_positional or args.environment
178
179 if args.lcd and not final_environment:
180 final_environment = "esp32s3"
181 print(
182 "\u2139\ufe0f --lcd flag requires ESP32-S3, auto-selecting 'esp32s3' environment"
183 )
184
185 if args.lcd_spi and not final_environment:
186 final_environment = "esp32s3"
187 print(
188 "\u2139\ufe0f --lcd-spi flag requires ESP32-S3, auto-selecting 'esp32s3' environment"
189 )
190
191 if args.lcd_rgb and not final_environment:
192 final_environment = "esp32p4"
193 print(
194 "\u2139\ufe0f --lcd-rgb flag requires ESP32-P4, auto-selecting 'esp32p4' environment"
195 )
196
197 # Driver selection
198 drivers: list[str] = []
199 simd_test_mode = args.simd
200 coroutine_test_mode = args.coroutine
201
202 if args.all:
203 drivers = [
204 "PARLIO",
205 "RMT",
206 "SPI",
207 "UART",
208 "LCD_CLOCKLESS",
209 "LCD_SPI",
210 "LCD_RGB",
211 "OBJECT_FLED",
212 "FLEX_IO",
213 "LPUART",
214 ]
215 else:
216 if args.parlio:
217 drivers.append("PARLIO")
218 if args.rmt:
219 drivers.append("RMT")
220 if args.spi:
221 drivers.append("SPI")
222 if args.uart:
223 drivers.append("UART")
224 if args.lcd:
225 drivers.append("LCD_CLOCKLESS")
226 if args.lcd_spi:
227 drivers.append("LCD_SPI")
228 if args.lcd_rgb:

Calls 9

parse_json_rpc_commandsFunction · 0.90
parse_timeoutFunction · 0.90
RunContextClass · 0.90
anyFunction · 0.85
printFunction · 0.50
appendMethod · 0.45
getMethod · 0.45
copyMethod · 0.45
resolveMethod · 0.45