justjanne / powerline-go

A beautiful and useful low-latency prompt for your shell, written in go
GNU General Public License v3.0
2.75k stars 269 forks source link

support for custom Kubernetes cluster name shortening with regex #327

Open joemiller opened 3 years ago

joemiller commented 3 years ago

Adds two new flags:

Examples:

Assume a kubernetes cluster named myorg-region-profile-cluster-01

Using the default template:

powerline-go -shorten-kube-names-regex-match '^myorg-\w+-\w+-(.*)'

result: cluster-01

Using a custom template:

powerline-go -shorten-kube-names-regex-match '^myorg-(\w+)-\w+-(.*)' -shorten-kube-names-regex-template '${1}/${2}'

result: region/cluster-01

joemiller commented 3 years ago

bump. anything i can do to help this PR along? tnx

joemiller commented 2 years ago

fixed up merge conflicts