.TH "md_src_plugins_rename_README" 3elektra "Sun May 29 2016" "Version 0.8.14" "Elektra" \" -*- nroff -*- .ad l .nh .SH NAME md_src_plugins_rename_README \- README .IP "\(bu" 2 infos = Information about keytometa plugin is in keys below .IP "\(bu" 2 infos/author = Felix Berlakovich elektra@berlakovich.net .IP "\(bu" 2 infos/licence = BSD .IP "\(bu" 2 infos/needs = .IP "\(bu" 2 infos/provides = filter .IP "\(bu" 2 infos/placements = presetstorage postgetstorage .IP "\(bu" 2 infos/description = renaming of keys .PP .PP This plugin can be used to perform rename operations on keys passing by\&. This might be useful if a backend does not provide keys in the required format\&. If keys are renamed, their original name is stored in the \fCorigname\fP MetaKey\&. .PP .SS "CUT" .PP .SS "OPERATION" .PP The cut operation can be used to strip parts of a keys name\&. The cut operation is able to cut anything starting after the path of the parent key\&. A renamed key may even replace the parent key\&. For example consider a KeySet with the parent key \fCuser/config\fP\&. If the KeySet contained a key with the name \fCuser/config/with/long/path/key1\fP, the cut operation would be able to strip the following key name parts: .IP "\(bu" 2 with .IP "\(bu" 2 with/long .IP "\(bu" 2 with/long/path .IP "\(bu" 2 with/long/path/key1 .PP .PP .SS "CONFIGURATION" .PP The cut operation takes as its only configuration parameter the key name part to strip\&. This configuration can be supplied in two different ways\&. First, the global configuration key \fCcut\fP can be used\&. Second, keys to be stripped can be tagged with the MetaKey \fCrename/cut\fP\&. If both options are given, the MetaKey takes precedence\&. For example, consider the following setup: .PP .nf `config/cut` = will/be parent key = user/config user/config/will/be/stripped/key1 <- meta rename/cut = will/be/stripped user/config/will/be/stripped/key2 <- meta rename/cut = will/be/stripped user/config/will/be/stripped/key3 user/config/will/not/be/stripped/key4 .fi .PP .PP The result of the cut operation would be the following KeySet: .PP .nf user/config/key1 user/config/key2 user/config/stripped/key3 user/config/will/not/be/stripped/key4 .fi .PP .PP The cut operation is agnostic to a single trailing slash in the configuration\&. This means that it makes no difference whether \fCcut = will/be/stripped\fP or \fCcut = will/be/stripped/\fP\&. However, the cut operation refuses cut paths with leading slash\&. This is to clarify that key name parts can only be stripped after the parent key path\&. .PP If an invalid configuration is given or the cut operation would cause a parent key duplicate, the affected keys are simply skipped and not renamed\&. .PP .SS "PLANNED OPERATIONS" .PP Additional rename operations are planned for future versions of the rename plugin: .IP "\(bu" 2 trim: remove spaces in the name (that are not part of parentKey!) .IP "\(bu" 2 case: upper/lowercase the name (that are not part of parentKey!) .PP