cocur / slugify

Converts a string to a slug. Includes integrations for Symfony, Silex, Laravel, Zend Framework 2, Twig, Nette and Latte.
MIT License
2.87k stars 251 forks source link

Add command-line interface to this package? #318

Closed aadmathijssen closed 1 year ago

aadmathijssen commented 1 year ago

When writing command-line scripts, I frequently have the need for a command-line tool that allows me to transform strings to slugs. Because none of the existing CLI tools satisfied my needs, I have created a (still unpublished) CLI wrapper for the cocur/slugify package, where each option that can be supplied via the Slugify constructor is available as a command-line option.

For instance the following example transforms a string to slug using the default,turkish rulesets and _ as separator, where tags are stripped and trimming is disabled:

$ echo 'Gülümsemek <strong>foo</strong>!' | bin/slugify --rulesets=default,turkish --separator=_ --strip-tags --no-trim
gulumsemek_foo_

Although I was planning on releasing this tool as a separate Composer package, I thought it might be beneficial to add this functionality to the cocur/slugify package instead. Is that something that might be considered? If so, then I will try to create a PR for this.

aadmathijssen commented 1 year ago

Today I have published the CLI wrapper as a separate Composer package.

Therefore, I will close this issue.

If there is any interest in the future to add a command-line interface to the library itself, this issue can be reopened.