I have following declaration for key/value pairs to be captured:
@Option(
names = "--aws-kms-tag,
mapFallbackValue = "",
description =
"Optional key-value pair to filter KMS keys based on tags. Format: --aws-kms-tag <tag-name>=<tag-value>. Can be repeated.",
paramLabel = "<TAG_NAME>=<TAG_VALUE>")
private Map<String, String> tags = new LinkedHashMap<>();
I can specify it on command line as follows and it works fine:
java myApp --aws-kms-tag tagNameA=tagValueA --aws-kms-tag tagNameB=tagValueB
However, my application is also using IDefaultValueProvider to capture values from configuration file and environment variables. The defaultValue method returns a String.
public interface IDefaultValueProvider {
String defaultValue(Model.ArgSpec var1) throws Exception;
}
If the option is not using a split RegExp, how can I assign multiple key=value pairs for defaultValue?
i.e. yaml configuration file would look like:
aws-kms-tag:
tagNameA: tagValueA
tagNameB: tagValueB
If above is not possible, I think I have to introduce split regexp approach that I use with Collection classes with setting arity to 0..1.
Reference of current Yaml based default provider:
I have following declaration for key/value pairs to be captured:
I can specify it on command line as follows and it works fine:
However, my application is also using IDefaultValueProvider to capture values from configuration file and environment variables. The defaultValue method returns a String.
If the option is not using a split RegExp, how can I assign multiple key=value pairs for defaultValue?
i.e. yaml configuration file would look like:
If above is not possible, I think I have to introduce split regexp approach that I use with Collection classes with setting arity to 0..1.
Reference of current Yaml based default provider:
https://github.com/ConsenSys/web3signer/blob/d43c899a79584d119514633e56d00e0566626afe/commandline/src/main/java/tech/pegasys/web3signer/commandline/valueprovider/YamlConfigFileDefaultProvider.java#L44
https://github.com/ConsenSys/web3signer/blob/ababf2651a219248fbd47b90a21c868d12fd3118/commandline/src/main/java/tech/pegasys/web3signer/commandline/valueprovider/EnvironmentVariableDefaultProvider.java#L24