Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

transform does not match absolute key path #3

Closed
vkhatri opened this issue May 9, 2016 · 1 comment
Closed

transform does not match absolute key path #3

vkhatri opened this issue May 9, 2016 · 1 comment
Labels

Comments

@vkhatri
Copy link

vkhatri commented May 9, 2016

Hello! This tool has saved me a lot of overhead, thank you for sharing this amazing tool.

I am having an issue with transform.

Currently transform matches the pattern anywhere in the path, e.g. --transform foo/x/y,foo/x/z will transform below mentioned key path:

a/b/c/foo/x/y/a/b/c -> a/b/c/foo/x/z/a/b/c
foo/x/y -> foo/x/z

But, i only intend to transform the foo/x/y to foo/x/z (which matches absolute path from left to right).

I know i can take the backup with prefix foo/x/y and then transform with the new key path as prefix matches absolute path from left to right. If this is the recommended way, i can submit a PR with this info for the transform option.

@aaronhurt
Copy link
Collaborator

aaronhurt commented May 9, 2016

The path transformation is actually just an implementation of strings.Replacer which takes value pairs as input. So you can actually specify multiple transforms with one option --transform="foo/x/y,foo/x/z,bar/x/y,bar/x/z"

I'll update the documentation to be more explicitly state that the transform option operates/matches anywhere within the path. To your specific use case you can also just fully qualify your transformations from the root, e.g. --transform="a/b/c/foo/x/y,a/b/c/foo/x/z" which will have your desired affect without having to add any extra steps or prefix options.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants