Shorten your strings using common abbreviations.
This tool comes out of a frustration of the name of resources (in my sepcific case, AWS stack names) being too long. Wouldn't it be nice if we could have a tool that would be able to suggest shorter alternatives if your original name is too long.
go get github.com/dnnrly/abbreviate
make build
This tool will attempt to shorten the string provided using common abbreviations
specified by language and 'set'.
Word boundaries will detect camel case and non-letter
Usage:
abbreviate [string] [flags]
Flags:
-c, --custom string Custom abbreviation set
-h, --help help for abbreviate
-l, --language string Language to select (default "en-us")
--list List all abbreviate sets by language
-m, --max int Maximum length of string, keep on abbreviating while the string is longer than this limit
-n, --newline Add newline to the end of the string (default true)
-s, --set string Abbreviation set (default "common")
Examples:
$ abbreviate strategy-limited
stg-ltd
$ abbreviate strategy-limited --max 11
strategy-ltd
This project adheres to the Contributor Covenant code of conduct. By participating, you are expected to uphold this code.
Pull requests are welcome. See the contributing guide for more details.
Please make sure to update tests as appropriate.