Github user alopresto commented on the issue:
https://github.com/apache/nifi/pull/2376
Ran `contrib-check` and all tests pass.
Ran a few scenarios using the tool. Everything looks good. The only slight
issue was when I intentionally ran with the wrong arguments and it looks like
the error message contains the whole option object and stacktrace in addition
to the flag, but it's clear enough for a user to understand the issue.
```
hw12203:...assembly/target/nifi-toolkit-1.5.0-SNAPSHOT-bin/nifi-toolkit-1.5.0-SNAPSHOT
(pr2376) alopresto
ð 271505s @ 11:01:23 $ ./bin/encrypt-config.sh --nifiRegistry -b
/Users/alopresto/Workspace/registry/nifi-registry-assembly/target/nifi-registry-0.0.1-SNAPSHOT-bin/nifi-registry-0.0.1-SNAPSHOT/conf/bootstrap.conf
-r
/Users/alopresto/Workspace/registry/nifi-registry-assembly/target/nifi-registry-0.0.1-SNAPSHOT-bin/nifi-registry-0.0.1-SNAPSHOT/conf/nifi-registry.properties
-R
/Users/alopresto/Workspace/registry/nifi-registry-assembly/target/nifi-registry-0.0.1-SNAPSHOT-bin/nifi-registry-0.0.1-SNAPSHOT/conf/nifi-registry-encrypted.properties
-v --decrypt
2018-01-08 11:01:40 DEBUG EncryptConfigLogger: Verbose mode is enabled
(goes to stderr by default).
2018-01-08 11:01:40 ERROR NiFiRegistryDecryptMode: Encountered an error:
Invalid options: --decrypt cannot be used with [[ option: R
outputNifiRegistryProperties [ARG] :: The destination nifi-registry.properties
file containing protected config values. :: class java.lang.String ]]. It
should only be used with -r and one of [-p, -k, -b].
java.lang.RuntimeException: Invalid options: --decrypt cannot be used with
[[ option: R outputNifiRegistryProperties [ARG] :: The destination
nifi-registry.properties file containing protected config values. :: class
java.lang.String ]]. It should only be used with -r and one of [-p, -k, -b].
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at
org.codehaus.groovy.reflection.CachedConstructor.invoke(CachedConstructor.java:80)
at
org.codehaus.groovy.reflection.CachedConstructor.doConstructorInvoke(CachedConstructor.java:74)
at
org.codehaus.groovy.runtime.callsite.ConstructorSite$ConstructorSiteNoUnwrap.callConstructor(ConstructorSite.java:84)
at
org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallConstructor(CallSiteArray.java:60)
at
org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:235)
at
org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:247)
at
org.apache.nifi.toolkit.encryptconfig.NiFiRegistryDecryptMode.run(NiFiRegistryDecryptMode.groovy:63)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at
org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite$PogoCachedMethodSite.invoke(PogoMetaMethodSite.java:169)
at
org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite.call(PogoMetaMethodSite.java:71)
at
org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
at
org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
at
org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:125)
at
org.apache.nifi.toolkit.encryptconfig.EncryptConfigMain.main(EncryptConfigMain.groovy:109)
Invalid options: --decrypt cannot be used with [[ option: R
outputNifiRegistryProperties [ARG] :: The destination nifi-registry.properties
file containing protected config values. :: class java.lang.String ]]. It
should only be used with -r and one of [-p, -k, -b].
```
+1, merging.
---