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

Method parse_args

ci/autoresearch/args.py:109–634  ·  view source on GitHub ↗

Parse command-line arguments and return Args dataclass instance.

(argv: list[str] | None = None)

Source from the content-addressed store, hash-verified

107
108 @staticmethod
109 def parse_args(argv: list[str] | None = None) -> "Args":
110 """Parse command-line arguments and return Args dataclass instance."""
111 parser = argparse.ArgumentParser(
112 description="FastLED AutoResearch Test Runner with JSON-RPC support",
113 formatter_class=argparse.RawDescriptionHelpFormatter,
114 epilog="""
115Examples:
116 %(prog)s --parlio # Auto-detect env, test only PARLIO driver
117 %(prog)s esp32s3 --parlio # Test esp32s3, PARLIO driver
118 %(prog)s --rmt --spi # Test RMT and SPI drivers
119 %(prog)s --all # Test all drivers
120 %(prog)s --parlio --skip-lint # Skip linting for faster iteration
121 %(prog)s --rmt --timeout 120 # Custom timeout (default: 60s)
122 %(prog)s --lcd --lanes 2 --strip-sizes 100,300 # Test LCD_CLOCKLESS with 2 lanes, strips of 100 and 300 LEDs
123 %(prog)s --lcd-spi --strip-sizes 100,500 # Test LCD_SPI (APA102) on ESP32-S3
124 %(prog)s --parlio --lanes 1-4 # Test PARLIO with 1-4 lanes
125 %(prog)s --rmt --strip-sizes small # Test RMT with 'small' preset (100/500 LEDs)
126 %(prog)s --lcd --lane-counts 100,200,300 # Test LCD_CLOCKLESS with 3 lanes (100, 200, 300 LEDs per lane)
127 %(prog)s --parlio --color-pattern 0xff00aa # Test PARLIO with custom color pattern (RGB hex)
128 %(prog)s --help # Show this help message
129
130Driver Selection (JSON-RPC):
131 Driver selection happens at runtime via JSON-RPC (no recompilation needed).
132 You can instantly switch between drivers without rebuilding firmware.
133
134 MANDATORY: You MUST specify at least one driver flag:
135 --parlio Test only PARLIO driver
136 --rmt Test only RMT driver
137 --spi Test only SPI driver
138 --uart Test only UART driver
139 --lcd Test only LCD_CLOCKLESS driver (ESP32-S3 only, replaces misnamed I2S)
140 --lcd-spi Test only LCD_SPI driver (ESP32-S3 only, APA102/SK9822)
141 --lcd-rgb Test only LCD RGB driver (ESP32-P4 only)
142 --object-fled Test only ObjectFLED DMA driver (Teensy 4.x)
143 --lpuart Test only LPUART driver (Teensy 4.x; eDMA-backed UART TX, pinned to pin 1 by default)
144 --all Test all drivers
145
146Strip Size Configuration:
147 Configure LED strip sizes for autoresearch testing via JSON-RPC:
148 --strip-sizes <preset or custom> Set strip sizes (preset or comma-separated counts)
149
150 Presets (shortcuts for common configurations):
151 tiny - 10, 100 LEDs
152 small - 100, 500 LEDs (default)
153 medium - 300, 1000 LEDs
154 large - 500, 3000 LEDs
155 xlarge - 1000, 5000 LEDs (high-memory devices only)
156
157 Custom arrays (comma-separated LED counts):
158 --strip-sizes 100,300 Test with 100 and 300 LED strips
159 --strip-sizes 100,300,1000 Test with 100, 300, and 1000 LED strips
160 --strip-sizes 500 Test with single 500 LED strip
161
162Lane Configuration:
163 Configure number of lanes for autoresearch testing via JSON-RPC:
164 --lanes <N or MIN-MAX> Set lane count or range
165 --lane-counts <LED1,LED2,...> Set per-lane LED counts (comma-separated)
166

Callers 15

mainFunction · 0.80
mainFunction · 0.80
parse_argsFunction · 0.80
mainFunction · 0.80
mainFunction · 0.80
mainFunction · 0.80
mainFunction · 0.80
mainFunction · 0.80
parse_argsFunction · 0.80
parse_argsFunction · 0.80
parse_argsFunction · 0.80

Calls 2

ArgsClass · 0.70
printFunction · 0.50

Tested by 15

parse_argsFunction · 0.64
parse_argsFunction · 0.64
parse_argsFunction · 0.64
mainFunction · 0.64
mainFunction · 0.64
parse_argsFunction · 0.64
mainFunction · 0.64
mainFunction · 0.64
mainFunction · 0.64
mainFunction · 0.64
mainFunction · 0.64
mainFunction · 0.64