Commit d29cb66
committed
fix(gui): properly handle -ez True/False from notebook args
Root cause: argparse short flags must be single letter (-e), but '-ez'
is 2 chars. argparse parsed '-e' as the flag and 'z' as its value,
then the next token (True/False) became an unrecognized argument.
Notebook calls: python gui.py --share -ez $ez (where $ez=True/False)
Fix: Pre-normalize sys.argv before argparse runs:
- '-ez True' / '--ez true' -> '--easy true'
- '-ez False' / '--ez false' -> stripped (easy stays disabled)
- 'ez' / 'easygui' (positional) -> '--easy true'
- '--easy' now uses type=str with parse_known_args() for compat
with both --easy (store_true) and --easy true (value) patterns1 parent 5be4d3e commit d29cb66
1 file changed
Lines changed: 32 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
335 | 335 | | |
336 | 336 | | |
337 | 337 | | |
338 | | - | |
339 | | - | |
340 | | - | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
341 | 367 | | |
342 | 368 | | |
343 | 369 | | |
| |||
346 | 372 | | |
347 | 373 | | |
348 | 374 | | |
349 | | - | |
| 375 | + | |
350 | 376 | | |
351 | 377 | | |
| 378 | + | |
352 | 379 | | |
353 | 380 | | |
354 | 381 | | |
| |||
357 | 384 | | |
358 | 385 | | |
359 | 386 | | |
360 | | - | |
| 387 | + | |
361 | 388 | | |
362 | 389 | | |
0 commit comments