Elektra
0.8.17
|
The Enum plugin checks string values of Keys by comparing it against a list of valid values.
The plugin checks every Key in the Keyset for the Metakey check/enum
containing a list with the syntax `'string1', 'string2', 'string3', ..., 'stringN'` and compares each value with the string value of the Key. If no match is found an error is returned.
kdb mount enum.ecf /example/enum enum kdb set user/example/enum/value middle # init to something valid kdb setmeta user/example/enum/value check/enum "'low', 'middle', 'high'" kdb set user/example/enum/value low # success kdb set user/example/enum/value no # fail