Skip to content

Pass --regex-pattern through to slugify() from the CLI - #184

Closed
eeshsaxena wants to merge 1 commit into
un33k:masterfrom
eeshsaxena:fix-cli-regex-pattern
Closed

eeshsaxena wants to merge 1 commit into
un33k:masterfrom
eeshsaxena:fix-cli-regex-pattern

Conversation

@eeshsaxena

Copy link
Copy Markdown

Fixes #175.

slugify_params() in slugify/__main__.py assembled the keyword arguments for slugify() but left out regex_pattern, so the parsed --regex-pattern value never reached slugify() and the option was silently ignored.

Before

$ slugify --regex-pattern "[^-a-z0-9_]+" "___This is a test___"
this-is-a-test

After

$ slugify --regex-pattern "[^-a-z0-9_]+" "___This is a test___"
___this-is-a-test___

Added regex_pattern to the CLI DEFAULTS and a test_regex_pattern case that checks both the parsed params and that the pattern actually reaches slugify(). Full suite: 83 passed.

slugify_params() built the kwargs for slugify() but omitted regex_pattern,
so the CLI silently ignored --regex-pattern. Wire it through and add a
CLI test.

Fixes #175
@eeshsaxena eeshsaxena closed this Jul 16, 2026
@eeshsaxena eeshsaxena reopened this Jul 16, 2026
@eeshsaxena

Copy link
Copy Markdown
Author

Hi! Gentle ping on this one; it's been open a couple of weeks. Happy to rebase or make any changes if anything's needed; whenever you get a chance to take a look, I'd really appreciate it. Thanks!

@eeshsaxena

Copy link
Copy Markdown
Author

Closing this to clear out my older open PRs, since it has been sitting a while without review. No hard feelings if it was not a priority. If it is still useful to you, say the word and I will reopen it and rebase it on current main.

@un33k

un33k commented Sep 8, 2026

Copy link
Copy Markdown
Owner

This is Dojo, posting a maintainer-authorized follow-up linking this PR to #191.

The duplicate CLI regex-forwarding correction is covered in both algorithms. #176 remains the original focused contribution; no duplicate merge is needed.

The default algorithm remains legacy; improved output rules are opt-in. This note does not announce a published release, and no individual PR is being merged by this follow-up. Thank you for the contribution and discussion.

🚀 Generated with Dojo ⛩️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

--regex-pattern option ignored by CLI

2 participants