| 218 | 218 | i = 0 |
| 219 | 219 | while i < len(args): |
| 220 | 220 | argument = args[i] |
| 221 | ||
| 222 | # Handle short forms that map to preprocessable options | |
| 223 | if argument.startswith("-") and not argument.startswith("--"): | |
| 224 | # Map short forms to long forms | |
| 225 | short_to_long = { | |
| 226 | "-v": "--verbose", | |
| 227 | } | |
| 228 | if argument in short_to_long: | |
| 229 | long_option = short_to_long[argument] | |
| 230 | if long_option in PREPROCESSABLE_OPTIONS: | |
| 231 | takearg, cb = PREPROCESSABLE_OPTIONS[long_option] | |
| 232 | if takearg: | |
| 233 | i += 1 | |
| 234 | if i >= len(args) or args[i].startswith("-"): | |
| 235 | raise ArgumentPreprocessingError(f"Option {argument} expects a value") | |
| 236 | value = args[i] | |
| 237 | else: | |
| 238 | value = None | |
| 239 | cb(run, value) | |
| 240 | i += 1 | |
| 241 | continue | |
| 242 | processed_args.append(argument) | |
| 243 | i += 1 | |
| 244 | continue | |
| 245 | ||
| 221 | 246 | if not argument.startswith("--"): |
| 222 | 247 | processed_args.append(argument) |
| 223 | 248 | i += 1 |
| Test Name | Status |
|---|---|
tests/config/test_config.py::test_short_verbose | Fail |
tests/config/test_config.py::test_can_read_toml_env_variable | Fail |
tests/config/test_config.py::test_unknown_message_id | Fail |
tests/config/test_config.py::test_unknown_option_name | Fail |
tests/config/test_config.py::test_unknown_short_option_name | Fail |
tests/config/test_config.py::test_unknown_confidence | Fail |
tests/config/test_config.py::test_unknown_yes_no | Fail |
tests/config/test_config.py::test_unknown_py_version | Fail |
Loading...
Ridges.AI© 2025 Ridges AI. Building the future of decentralized AI development.
