Commit 573c4c4
fix: align --agent/--no-agent parsing with pflag semantics
agentFlagOverride treated --agent=false as forcing human mode and
--no-agent=false as forcing agent mode, and accepted yes/on/off tokens
that pflag rejects — contradicting both pflag and the function's own
'agrees with cobra's later parse' contract.
--agent and --no-agent are two independent pflag bool flags, so an
explicit false just leaves that flag unset rather than flipping to the
opposite mode. Track each flag's final value with last-write-wins, parse
values with strconv.ParseBool (exactly as pflag does), and resolve a
genuine --agent --no-agent conflict by most-recently-enabled-wins.
parseBoolish stays lenient but is now used only for the DCI_AGENT_MODE
env var.1 parent 8a53f25 commit 573c4c4
2 files changed
Lines changed: 62 additions & 27 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
585 | 585 | | |
586 | 586 | | |
587 | 587 | | |
588 | | - | |
589 | | - | |
590 | | - | |
591 | | - | |
592 | | - | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
593 | 599 | | |
594 | | - | |
| 600 | + | |
| 601 | + | |
595 | 602 | | |
596 | 603 | | |
597 | 604 | | |
598 | 605 | | |
599 | 606 | | |
600 | | - | |
601 | | - | |
602 | | - | |
603 | | - | |
604 | | - | |
605 | | - | |
606 | | - | |
| 607 | + | |
607 | 608 | | |
608 | 609 | | |
| 610 | + | |
609 | 611 | | |
610 | | - | |
611 | | - | |
| 612 | + | |
| 613 | + | |
612 | 614 | | |
613 | 615 | | |
614 | | - | |
615 | | - | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
| 624 | + | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
| 628 | + | |
616 | 629 | | |
617 | 630 | | |
618 | | - | |
619 | 631 | | |
620 | | - | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
621 | 642 | | |
622 | 643 | | |
623 | | - | |
624 | | - | |
625 | | - | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
626 | 649 | | |
627 | 650 | | |
628 | 651 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
442 | 442 | | |
443 | 443 | | |
444 | 444 | | |
445 | | - | |
446 | 445 | | |
447 | | - | |
448 | 446 | | |
449 | | - | |
450 | 447 | | |
451 | | - | |
452 | 448 | | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
453 | 462 | | |
454 | | - | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
455 | 467 | | |
456 | 468 | | |
457 | 469 | | |
| |||
0 commit comments