Skip to content

🐛 fix(titles): handle multi-word prog names in group titles#289

Merged
gaborbernat merged 1 commit intotox-dev:mainfrom
gaborbernat:fix-multiword-prog
Mar 2, 2026
Merged

🐛 fix(titles): handle multi-word prog names in group titles#289
gaborbernat merged 1 commit intotox-dev:mainfrom
gaborbernat:fix-multiword-prog

Conversation

@gaborbernat
Copy link
Member

@gaborbernat gaborbernat commented Mar 2, 2026

Programs with spaces in their prog (e.g. python -m build) had their section titles and group headings corrupted. 🐛 The title-building logic naively split prog on whitespace to separate the program name from subcommand names, so python -m build was interpreted as prog=python with subcommand -m — producing nonsensical headings.

The fix threads the actual root prog value through the title-building methods and uses its length to correctly locate the subcommand portion, rather than assuming prog is always a single word. This preserves existing behavior for single-word programs while correctly handling multi-word ones like python -m build.

Fixes #68

@gaborbernat gaborbernat added the bug Something isn't working label Mar 2, 2026
Programs with spaces in their prog (e.g. `python -m build`) had their
group titles corrupted because the title-building code split on spaces
to separate the prog name from subcommands. Now uses the actual root
prog length to find the subcommand portion.

Fixes tox-dev#68
@gaborbernat gaborbernat merged commit 7bc2756 into tox-dev:main Mar 2, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Options and posargs titles appear corrupted (sometimes?)

1 participant