diff --git a/attribution.txt b/attribution.txt
index 1a41901..444a7bc 100644
--- a/attribution.txt
+++ b/attribution.txt
@@ -188,18 +188,6 @@ That's all there is to it!
-------------------------------------------------------------------------------------------------------------------------------
-Package: ch.qos.logback:logback-core:1.2.3
-
-License: EPL-1.0 OR LGPL-2.1-only
-
-Copyrights:
-
-
-License Text:
-EPL-1.0 OR LGPL-2.1-only
-
--------------------------------------------------------------------------------------------------------------------------------
-
Package: org.javassist:javassist:3.21.0-GA
License: LGPL-2.1
@@ -402,18 +390,6 @@ https://opensource.org/licenses/BSD-2-Clause
-------------------------------------------------------------------------------------------------------------------------------
-Package: ch.qos.logback:logback-classic:1.2.3
-
-License: EPL-1.0 OR LGPL-2.1-only
-
-Copyrights:
-Copyright (c) 1999-2010, QOS.ch.,Copyright (c) 1999-2012, QOS.ch.,Copyright (c) 1999-2015, QOS.ch.
-
-License Text:
-EPL-1.0 OR LGPL-2.1-only
-
--------------------------------------------------------------------------------------------------------------------------------
-
Package: org.spockframework:spock-core:2.0-M3-groovy-3.0
License: Apache-2.0
@@ -792,26 +768,34 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
-------------------------------------------------------------------------------------------------------------------------------
-Package: com.optum.sourcehawk:sourcehawk-configuration:0.1.0-SNAPSHOT
+Package: org.slf4j:slf4j-api:1.7.30
-License: Apache License 2.0
+License: MIT
Copyrights:
License Text:
-http://www.apache.org/licenses/LICENSE-2.0
+MIT License
+
+Copyright (c)
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-------------------------------------------------------------------------------------------------------------------------------
-Package: org.slf4j:slf4j-api:1.7.30
+Package: org.slf4j:slf4j-nop:1.7.30
License: MIT
-Copyrights:
+Copyrights:
-License Text:
+License Text:
MIT License
Copyright (c)
@@ -1651,245 +1635,221 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-------------------------------------------------------------------------------------------------------------------------------
-Package: com.optum.sourcehawk:sourcehawk-exec:0.1.0-SNAPSHOT
+Package: commons-lang:commons-lang:2.6
-License: Apache License 2.0
+License: Apache-2.0
Copyrights:
-
+Copyright 2001-2011 The Apache Software Foundation
License Text:
-http://www.apache.org/licenses/LICENSE-2.0
--------------------------------------------------------------------------------------------------------------------------------
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
-Package: commons-lang:commons-lang:2.6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-License: Apache-2.0
+ 1. Definitions.
-Copyrights:
-Copyright 2001-2011 The Apache Software Foundation
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
-License Text:
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
--------------------------------------------------------------------------------------------------------------------------------
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
-Package: com.optum.sourcehawk:sourcehawk-protocol-file:0.1.0-SNAPSHOT
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
-License: Apache License 2.0
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
-Copyrights:
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
-License Text:
-http://www.apache.org/licenses/LICENSE-2.0
-------------------------------------------------------------------------------------------------------------------------------
-Package: com.fasterxml.jackson.core:jackson-annotations:2.11.2
+Package: com.fasterxml.jackson.core:jackson-annotations:2.11.4
License: Apache-2.0
@@ -2557,43 +2517,27 @@ limitations under the License.
-------------------------------------------------------------------------------------------------------------------------------
-Package: com.optum.sourcehawk:sourcehawk-enforcer-file-core:0.1.0-SNAPSHOT
+Package: com.fasterxml.jackson.core:jackson-databind:2.11.4
-License: Apache License 2.0
+License: Apache-2.0
Copyrights:
License Text:
-http://www.apache.org/licenses/LICENSE-2.0
-
--------------------------------------------------------------------------------------------------------------------------------
-
-Package: com.optum.sourcehawk:sourcehawk-protocol-core:0.1.0-SNAPSHOT
-
-License: undefined
-
-Copyrights:
+This copy of Jackson JSON processor databind module is licensed under the
+Apache (Software) License, version 2.0 ("the License").
+See the License for details about distribution rights, and the
+specific rights regarding derivate works.
+You may obtain a copy of the License at:
-License Text:
http://www.apache.org/licenses/LICENSE-2.0
--------------------------------------------------------------------------------------------------------------------------------
-
-Package: com.optum.sourcehawk:sourcehawk-enforcer-file-maven:0.1.0-SNAPSHOT
-
-License: Apache License 2.0
-
-Copyrights:
-
-
-License Text:
-http://www.apache.org/licenses/LICENSE-2.0
-------------------------------------------------------------------------------------------------------------------------------
-Package: com.fasterxml.jackson.core:jackson-databind:2.11.2
+Package: com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.11.4
License: Apache-2.0
@@ -2601,7 +2545,7 @@ Copyrights:
License Text:
-This copy of Jackson JSON processor databind module is licensed under the
+This copy of Jackson JSON processor YAML module is licensed under the
Apache (Software) License, version 2.0 ("the License").
See the License for details about distribution rights, and the
specific rights regarding derivate works.
@@ -2613,7 +2557,7 @@ http://www.apache.org/licenses/LICENSE-2.0
-------------------------------------------------------------------------------------------------------------------------------
-Package: com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.11.2
+Package: com.fasterxml.jackson.core:jackson-core:2.11.4
License: Apache-2.0
@@ -2621,7 +2565,7 @@ Copyrights:
License Text:
-This copy of Jackson JSON processor YAML module is licensed under the
+This copy of Jackson JSON processor streaming parser/generator is licensed under the
Apache (Software) License, version 2.0 ("the License").
See the License for details about distribution rights, and the
specific rights regarding derivate works.
@@ -2630,110 +2574,110 @@ You may obtain a copy of the License at:
http://www.apache.org/licenses/LICENSE-2.0
-
-------------------------------------------------------------------------------------------------------------------------------
-Package: com.fasterxml.jackson.core:jackson-core:2.11.2
+Package: info.picocli:4.6.1
License: Apache-2.0
-Copyrights:
+Copyrights:
+Copyright 2017 Remko Popma
+License Text:
+Apache License
-License Text:
-This copy of Jackson JSON processor streaming parser/generator is licensed under the
-Apache (Software) License, version 2.0 ("the License").
-See the License for details about distribution rights, and the
-specific rights regarding derivate works.
+Version 2.0, January 2004
-You may obtain a copy of the License at:
+http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-http://www.apache.org/licenses/LICENSE-2.0
+ 1. Definitions.
--------------------------------------------------------------------------------------------------------------------------------
-Package: com.optum.sourcehawk:sourcehawk-enforcer-file-docker:0.1.0-SNAPSHOT
+ "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.
-License: undefined
-Copyrights:
+ "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.
-License Text:
-http://www.apache.org/licenses/LICENSE-2.0
--------------------------------------------------------------------------------------------------------------------------------
-Package: ch.qos.logback:logback-core:1.2.3
+ "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
-License: EPL-1.0 OR LGPL-2.1-only
-Copyrights:
+ "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License.
-License Text:
-EPL-1.0 OR LGPL-2.1-only
--------------------------------------------------------------------------------------------------------------------------------
-Package: com.optum.sourcehawk:sourcehawk-enforcer-file-common:0.1.0-SNAPSHOT
+ "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.
-License: undefined
-Copyrights:
+ "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.
-License Text:
-http://www.apache.org/licenses/LICENSE-2.0
--------------------------------------------------------------------------------------------------------------------------------
-Package: com.optum.sourcehawk:sourcehawk-enforcer-core:0.1.0-SNAPSHOT
+ "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).
-License: undefined
-Copyrights:
+ "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.
-License Text:
-http://www.apache.org/licenses/LICENSE-2.0
--------------------------------------------------------------------------------------------------------------------------------
-Package: com.optum.sourcehawk:sourcehawk-dist-linux:0.1.0-SNAPSHOT
+ "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution."
-License: undefined
-Copyrights:
+ "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.
-License Text:
-http://www.apache.org/licenses/LICENSE-2.0
+ 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.
--------------------------------------------------------------------------------------------------------------------------------
+ 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.
-Package: com.optum.sourcehawk:sourcehawk-core:0.1.0-SNAPSHOT
+ 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:
-License: undefined
+ (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and
-Copyrights:
+ (b) You must cause any modified files to carry prominent notices stating that You changed the files; and
+ (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and
-License Text:
-http://www.apache.org/licenses/LICENSE-2.0
+ (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License.
--------------------------------------------------------------------------------------------------------------------------------
+ You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.
-Package: ch.qos.logback:logback-classic:1.2.3
+ 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.
-License: EPL-1.0 OR LGPL-2.1-only
+ 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.
-Copyrights:
-Copyright (c) 1999-2010, QOS.ch.,Copyright (c) 1999-2012, QOS.ch.,Copyright (c) 1999-2015, QOS.ch.
+ 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.
-License Text:
-EPL-1.0 OR LGPL-2.1-only
+ 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.
--------------------------------------------------------------------------------------------------------------------------------
+ 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS
+
+APPENDIX: How to apply the Apache License to your work.
+
+To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives.
+
+Copyright [yyyy] [name of copyright owner]
+
+Licensed under the Apache License, Version 2.0 (the "License");
+
+you may not use this file except in compliance with the License.
+
+You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+
+distributed under the License is distributed on an "AS IS" BASIS,
+
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+
+See the License for the specific language governing permissions and
+limitations under the License.
\ No newline at end of file
diff --git a/cli/pom.xml b/cli/pom.xml
index 0c6d3f7..43762d6 100644
--- a/cli/pom.xml
+++ b/cli/pom.xml
@@ -31,7 +31,7 @@
**/picocli/**/*.*
- 4.5.2
+ 4.6.1
@@ -46,14 +46,8 @@
- ch.qos.logback
- logback-classic
- runtime
-
-
- org.fusesource.jansi
- jansi
- 1.17.1
+ org.slf4j
+ slf4j-nopruntime
@@ -228,9 +222,9 @@
jar
- ch.qos.logback
- logback-classic
- ${logback.version}
+ org.slf4j
+ slf4j-simple
+ ${slf4j.version}
@@ -371,7 +365,6 @@
- ch.qos.logback:*:*:*:*com.fasterxml.jackson.core:*:*:*:*com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:*:*com.jayway.jsonpath:json-path:*:*:*
@@ -379,8 +372,9 @@
net.minidev:json-smart:*:*:*org.apache.maven:maven-model:*:*:*org.codehaus.plexus:plexus-utils:*:*:*
- org.fusesource.jansi:jansi:*:*:*org.ow2.asm:asm:*:*:*
+ org.slf4j:slf4j-api:*:*:*
+ org.slf4j:slf4j-nop:*:*:*org.yaml:snakeyaml:*:*:*
diff --git a/cli/scripts/update-picocli.sh b/cli/scripts/update-picocli.sh
index 5a6517c..f4619ee 100755
--- a/cli/scripts/update-picocli.sh
+++ b/cli/scripts/update-picocli.sh
@@ -11,10 +11,11 @@ set -e
#########################################################################
# Retrieve Latest Version
-VERSION=$(curl -sI https://github.com/remkop/picocli/releases/latest | grep -i location | awk -F"/" '{ printf "%s", $NF }' | tr -d 'v' | tr -d '\r\n')
+VERSION=$(curl -sI https://github.com/remkop/picocli/releases/latest | grep -i location: | awk -F"/" '{ printf "%s", $NF }' | tr -d 'v' | tr -d '\r\n')
# Global Variables
DIR="$( cd "$( dirname "$( dirname "${BASH_SOURCE[0]}" )")" && pwd )"
+ROOT_DIR="$( cd "$( dirname "$( dirname "$( dirname "${BASH_SOURCE[0]}" )")")" && pwd )"
BASE_URL="https://raw.githubusercontent.com/remkop/picocli"
LICENSE_URL="$BASE_URL/v$VERSION/LICENSE"
LICENSE_FILE_PATH="$DIR/src/main/resources/META-INF/licenses/picocli.txt"
@@ -32,6 +33,9 @@ sed -i 's/public\sclass\sCommandLine/@SuppressWarnings({"rawtypes", "deprecation
# Replace the version in pom.xml file for plugin references
sed -i "s/[-[:alnum:]./]\{1,\}<\/picocli.version>/$VERSION<\/picocli.version>/" "$DIR/pom.xml"
+# Replace the version in attribution.txt file
+sed -i "s/Package: info.picocli:[-[:alnum:]./]\{1,\}/Package: info.picocli:$VERSION/" "$ROOT_DIR/attribution.txt"
+
# Remove TODOs so not highlighted in editor
sed -i 's/TODO/TIDO/g' "$SOURCE_FILE_PATH"
diff --git a/cli/src/main/java/com/optum/sourcehawk/cli/BitbucketScanCommand.java b/cli/src/main/java/com/optum/sourcehawk/cli/BitbucketScanCommand.java
index 5f064ea..30c254b 100644
--- a/cli/src/main/java/com/optum/sourcehawk/cli/BitbucketScanCommand.java
+++ b/cli/src/main/java/com/optum/sourcehawk/cli/BitbucketScanCommand.java
@@ -5,7 +5,6 @@
import com.optum.sourcehawk.core.data.RemoteRef;
import com.optum.sourcehawk.core.repository.BitbucketRepositoryFileReader;
import com.optum.sourcehawk.core.repository.RepositoryFileReader;
-import lombok.extern.slf4j.Slf4j;
import lombok.val;
import picocli.CommandLine;
@@ -19,7 +18,6 @@
*
* @author Brian Wyka
*/
-@Slf4j
@CommandLine.Command(
name = "bitbucket",
aliases = "bb",
diff --git a/cli/src/main/java/com/optum/sourcehawk/cli/CommandOptions.java b/cli/src/main/java/com/optum/sourcehawk/cli/CommandOptions.java
index ce9843b..ceba6c5 100644
--- a/cli/src/main/java/com/optum/sourcehawk/cli/CommandOptions.java
+++ b/cli/src/main/java/com/optum/sourcehawk/cli/CommandOptions.java
@@ -46,7 +46,7 @@ static class Exec {
@CommandLine.Option(
names = {"-f", "--output-format"},
description = "Output Format, valid values: ${COMPLETION-CANDIDATES}",
- defaultValue = "CONSOLE",
+ defaultValue = "TEXT",
showDefaultValue = CommandLine.Help.Visibility.ALWAYS
)
OutputFormat outputFormat;
diff --git a/cli/src/main/java/com/optum/sourcehawk/cli/FixCommand.java b/cli/src/main/java/com/optum/sourcehawk/cli/FixCommand.java
index bd182dc..e0770af 100644
--- a/cli/src/main/java/com/optum/sourcehawk/cli/FixCommand.java
+++ b/cli/src/main/java/com/optum/sourcehawk/cli/FixCommand.java
@@ -7,7 +7,6 @@
import com.optum.sourcehawk.exec.fix.FixExecutor;
import com.optum.sourcehawk.exec.fix.FixResultFactory;
import com.optum.sourcehawk.exec.fix.FixResultLogger;
-import lombok.extern.slf4j.Slf4j;
import lombok.val;
import picocli.CommandLine;
@@ -18,7 +17,6 @@
*
* @author Brian Wyka
*/
-@Slf4j
@CommandLine.Command(
name = "fix",
aliases = { "correct", "resolve" },
diff --git a/cli/src/main/java/com/optum/sourcehawk/cli/FlattenConfigCommand.java b/cli/src/main/java/com/optum/sourcehawk/cli/FlattenConfigCommand.java
index 75e6bae..8d78818 100644
--- a/cli/src/main/java/com/optum/sourcehawk/cli/FlattenConfigCommand.java
+++ b/cli/src/main/java/com/optum/sourcehawk/cli/FlattenConfigCommand.java
@@ -2,12 +2,10 @@
import com.optum.sourcehawk.core.constants.SourcehawkConstants;
import com.optum.sourcehawk.core.result.FlattenConfigResult;
-import com.optum.sourcehawk.core.utils.StringUtils;
import com.optum.sourcehawk.core.utils.Try;
-import com.optum.sourcehawk.exec.ExecLoggers;
+import com.optum.sourcehawk.exec.Console;
import com.optum.sourcehawk.exec.config.FlattenConfigExecutor;
import com.optum.sourcehawk.exec.config.FlattenConfigResultLogger;
-import lombok.extern.slf4j.Slf4j;
import lombok.val;
import picocli.CommandLine;
@@ -20,7 +18,6 @@
*
* @author Christian Oestreich
*/
-@Slf4j
@CommandLine.Command(
name = "flatten-config",
aliases = {"fc", "flatten"},
@@ -60,12 +57,9 @@ public static void main(final String... args) {
*/
public Integer call() {
val configurationFileLocation = getConfigurationFileLocation();
- if (StringUtils.isBlankOrEmpty(configurationFileLocation)) {
- return CommandLine.ExitCode.SOFTWARE;
- }
val flattenConfigResult = execute(configurationFileLocation);
if (flattenConfigResult.isError()) {
- ExecLoggers.CONSOLE_RAW.info(flattenConfigResult.getMessage());
+ Console.Err.log(flattenConfigResult.getMessage());
return CommandLine.ExitCode.SOFTWARE;
}
FlattenConfigResultLogger.log(flattenConfigResult, outputPath);
diff --git a/cli/src/main/java/com/optum/sourcehawk/cli/GithubScanCommand.java b/cli/src/main/java/com/optum/sourcehawk/cli/GithubScanCommand.java
index 16c311d..784cf1f 100644
--- a/cli/src/main/java/com/optum/sourcehawk/cli/GithubScanCommand.java
+++ b/cli/src/main/java/com/optum/sourcehawk/cli/GithubScanCommand.java
@@ -5,7 +5,6 @@
import com.optum.sourcehawk.core.data.RemoteRef;
import com.optum.sourcehawk.core.repository.GithubRepositoryFileReader;
import com.optum.sourcehawk.core.repository.RepositoryFileReader;
-import lombok.extern.slf4j.Slf4j;
import lombok.val;
import picocli.CommandLine;
@@ -19,7 +18,6 @@
*
* @author Brian Wyka
*/
-@Slf4j
@CommandLine.Command(
name = "github",
aliases = "gh",
diff --git a/cli/src/main/java/com/optum/sourcehawk/cli/ScanCommand.java b/cli/src/main/java/com/optum/sourcehawk/cli/ScanCommand.java
index 3e34cf1..ba84134 100644
--- a/cli/src/main/java/com/optum/sourcehawk/cli/ScanCommand.java
+++ b/cli/src/main/java/com/optum/sourcehawk/cli/ScanCommand.java
@@ -7,7 +7,6 @@
import com.optum.sourcehawk.exec.scan.ScanExecutor;
import com.optum.sourcehawk.exec.scan.ScanResultFactory;
import com.optum.sourcehawk.exec.scan.ScanResultLogger;
-import lombok.extern.slf4j.Slf4j;
import lombok.val;
import picocli.CommandLine;
@@ -18,7 +17,6 @@
*
* @author Brian Wyka
*/
-@Slf4j
@CommandLine.Command(
name = "scan",
aliases = { "flyover", "survey" },
diff --git a/cli/src/main/java/com/optum/sourcehawk/cli/Sourcehawk.java b/cli/src/main/java/com/optum/sourcehawk/cli/Sourcehawk.java
index 21f41ec..28f1e86 100644
--- a/cli/src/main/java/com/optum/sourcehawk/cli/Sourcehawk.java
+++ b/cli/src/main/java/com/optum/sourcehawk/cli/Sourcehawk.java
@@ -19,6 +19,10 @@
aliases = "shawk",
description = "Watch over your source like a hawk",
mixinStandardHelpOptions = true,
+ headerHeading = "@|fg(magenta) >_ S O U R C E H A W K|@",
+ synopsisHeading = "%n",
+ commandListHeading ="%nCommands:%n",
+ footer = "Copyright (c) 2020 Optum",
versionProvider = Sourcehawk.VersionProvider.class,
subcommands = {
CommandLine.HelpCommand.class,
@@ -36,7 +40,13 @@ public class Sourcehawk {
* @param args the command line args
*/
public static void main(final String[] args) {
- val status = new CommandLine(new Sourcehawk()).execute(args);
+ val defaultColorScheme = CommandLine.Help.defaultColorScheme(CommandLine.Help.Ansi.AUTO);
+ val colorScheme = new CommandLine.Help.ColorScheme.Builder(defaultColorScheme)
+ .commands(CommandLine.Help.Ansi.Style.bold, CommandLine.Help.Ansi.Style.fg_cyan)
+ .build();
+ val status = new CommandLine(new Sourcehawk())
+ .setColorScheme(colorScheme)
+ .execute(args);
Runtime.getRuntime().halt(status);
}
diff --git a/cli/src/main/java/com/optum/sourcehawk/cli/ValidateConfigCommand.java b/cli/src/main/java/com/optum/sourcehawk/cli/ValidateConfigCommand.java
index 9079d54..84c3100 100644
--- a/cli/src/main/java/com/optum/sourcehawk/cli/ValidateConfigCommand.java
+++ b/cli/src/main/java/com/optum/sourcehawk/cli/ValidateConfigCommand.java
@@ -12,7 +12,7 @@
import com.optum.sourcehawk.core.utils.StringUtils;
import com.optum.sourcehawk.enforcer.file.FileEnforcer;
import com.optum.sourcehawk.exec.ConfigurationReader;
-import com.optum.sourcehawk.exec.ExecLoggers;
+import com.optum.sourcehawk.exec.Console;
import lombok.val;
import picocli.CommandLine;
@@ -77,34 +77,34 @@ public Integer call() {
if (Files.exists(childConfigFilePath)) {
sourcehawkConfiguration = ConfigurationReader.parseConfiguration(childConfigFilePath);
} else {
- ExecLoggers.CONSOLE_RAW.error("Configuration file is a directory and does not contain {} file", SourcehawkConstants.DEFAULT_CONFIG_FILE_NAME);
+ Console.Err.log("Configuration file is a directory and does not contain %s file", SourcehawkConstants.DEFAULT_CONFIG_FILE_NAME);
return CommandLine.ExitCode.USAGE;
}
} else if (Files.exists(configFilePath)) {
sourcehawkConfiguration = ConfigurationReader.parseConfiguration(configFilePath);
} else {
- ExecLoggers.CONSOLE_RAW.error("Configuration not provided through stdin or via file path");
+ Console.Err.log("Configuration not provided through stdin or via file path");
return CommandLine.ExitCode.USAGE;
}
} catch (final PropertyBindingException e) {
val context = String.format("at line %d, column %d", e.getLocation().getLineNr(), e.getLocation().getColumnNr());
- ExecLoggers.CONSOLE_RAW.error("* {}", deriveErrorMessage(context, e));
+ Console.Err.log("* %s", deriveErrorMessage(context, e));
return CommandLine.ExitCode.SOFTWARE;
} catch (final Exception e) {
- ExecLoggers.CONSOLE_RAW.error("* {}", deriveErrorMessage("unknown", e));
+ Console.Err.log("* %s", deriveErrorMessage("unknown", e));
return CommandLine.ExitCode.SOFTWARE;
}
if (CollectionUtils.isEmpty(sourcehawkConfiguration.getConfigLocations()) && CollectionUtils.isEmpty(sourcehawkConfiguration.getFileProtocols())) {
- ExecLoggers.CONSOLE_RAW.warn("There are no remote configurations or file protocols in your config file, scans may produce no results");
+ Console.Out.log("There are no remote configurations or file protocols in your config file, scans may produce no results");
}
val fileEnforcerErrors = compileFileEnforcerErrors(sourcehawkConfiguration.getFileProtocols());
if (fileEnforcerErrors.isEmpty()) {
- ExecLoggers.CONSOLE_RAW.info("Congratulations, you have created a valid configuration file");
+ Console.Out.log("Congratulations, you have created a valid configuration file");
return CommandLine.ExitCode.OK;
}
fileEnforcerErrors.stream()
.map(fileEnforcerError -> String.format("* %s", fileEnforcerError))
- .forEach(ExecLoggers.CONSOLE_RAW::error);
+ .forEach(Console.Err::log);
return CommandLine.ExitCode.SOFTWARE;
}
diff --git a/cli/src/main/java/picocli/CommandLine.java b/cli/src/main/java/picocli/CommandLine.java
index c1d7fe5..636662b 100644
--- a/cli/src/main/java/picocli/CommandLine.java
+++ b/cli/src/main/java/picocli/CommandLine.java
@@ -146,10 +146,10 @@
public class CommandLine {
/** This is picocli version {@value}. */
- public static final String VERSION = "4.5.2";
+ public static final String VERSION = "4.6.1";
private final Tracer tracer = new Tracer();
- private final CommandSpec commandSpec;
+ private CommandSpec commandSpec;
private final Interpreter interpreter;
private final IFactory factory;
@@ -219,14 +219,29 @@ public CommandLine(Object command) {
* @throws InitializationException if the specified command object does not have a {@link Command}, {@link Option} or {@link Parameters} annotation
* @since 2.2 */
public CommandLine(Object command, IFactory factory) {
+ this(command, factory, true);
+ }
+
+ private CommandLine(Object command, IFactory factory, boolean userCalled) {
this.factory = Assert.notNull(factory, "factory");
interpreter = new Interpreter();
commandSpec = CommandSpec.forAnnotatedObject(command, factory);
commandSpec.commandLine(this);
+ if (userCalled) { this.applyModelTransformations(); }
commandSpec.validate();
if (commandSpec.unmatchedArgsBindings().size() > 0) { setUnmatchedArgumentsAllowed(true); }
}
+ /** Apply transformers to command spec recursively. */
+ private void applyModelTransformations() {
+ if (commandSpec.modelTransformer != null) {
+ commandSpec = commandSpec.modelTransformer.transform(commandSpec);
+ }
+ for (CommandLine cmd : getSubcommands().values()) {
+ cmd.applyModelTransformations();
+ }
+ }
+
private CommandLine copy() {
CommandLine result = new CommandLine(commandSpec.copy(), factory); // create a new sub-hierarchy
result.err = err;
@@ -390,6 +405,11 @@ public T getCommand() {
return (T) getCommandSpec().userObject();
}
+ /** Returns the factory that this {@code CommandLine} was constructed with.
+ * @return the factory that this {@code CommandLine} was constructed with, never {@code null}
+ * @since 4.6 */
+ public IFactory getFactory() { return factory; }
+
/** Returns {@code true} if an option annotated with {@link Option#usageHelp()} was specified on the command line.
* @return whether the parser encountered an option annotated with {@link Option#usageHelp()}.
* @since 0.9.8 */
@@ -1151,7 +1171,7 @@ private static int mappedExitCode(Throwable t, IExitCodeExceptionMapper mapper,
}
/** Returns the color scheme to use when printing help.
- * The default value is the {@linkplain CommandLine.Help#defaultColorScheme(CommandLine.Help.Ansi) default color scheme} with {@link Help.Ansi#AUTO Ansi.AUTO}.
+ * The default value is the {@linkplain picocli.CommandLine.Help#defaultColorScheme(CommandLine.Help.Ansi) default color scheme} with {@link Help.Ansi#AUTO Ansi.AUTO}.
* @see #execute(String...)
* @see #usage(PrintStream)
* @see #usage(PrintWriter)
@@ -2081,7 +2101,7 @@ private static int handleUnhandled(Exception ex, CommandLine cmd, int defaultExi
}
/**
- * Convert an {@code Throwable} to a {@code String} , with message and stack traces extracted and colored
+ * Convert a {@code Throwable} to a {@code String} , with message and stack traces extracted and colored
* according to {@code ColorScheme}.
* @param t the {@code Throwable} to be converted
* @param existingColorScheme the {@code ColorScheme} to use
@@ -3493,9 +3513,17 @@ public CommandLine setNegatableOptionTransformer(INegatableOptionTransformer tra
private static boolean empty(String str) { return str == null || str.trim().length() == 0; }
private static boolean empty(Object[] array) { return array == null || array.length == 0; }
private static String str(String[] arr, int i) { return (arr == null || arr.length <= i) ? "" : arr[i]; }
+ private static boolean isBoolean(Class>[] types) { return isBoolean(types[0]) || (isOptional(types[0]) && isBoolean(types[1])); }
private static boolean isBoolean(Class> type) { return type == Boolean.class || type == Boolean.TYPE; }
- private static CommandLine toCommandLine(Object obj, IFactory factory) { return obj instanceof CommandLine ? (CommandLine) obj : new CommandLine(obj, factory);}
+ private static CommandLine toCommandLine(Object obj, IFactory factory) { return obj instanceof CommandLine ? (CommandLine) obj : new CommandLine(obj, factory, false);}
private static boolean isMultiValue(Class> cls) { return cls.isArray() || Collection.class.isAssignableFrom(cls) || Map.class.isAssignableFrom(cls); }
+ private static boolean isOptional(Class> cls) { return cls != null && "java.util.Optional".equals(cls.getName()); } // #1108
+ private static Object getOptionalEmpty() throws Exception {
+ return Class.forName("java.util.Optional").getMethod("empty").invoke(null);
+ }
+ private static Object getOptionalOfNullable(Object newValue) throws Exception {
+ return Class.forName("java.util.Optional").getMethod("ofNullable", Object.class).invoke(null, newValue);
+ }
private static String format(String formatString, Object... params) {
try {
return formatString == null ? "" : String.format(formatString, params);
@@ -3506,6 +3534,14 @@ private static String format(String formatString, Object... params) {
return formatString;
}
}
+ private static Map mapOf(String key, Object value, Object... other) {
+ LinkedHashMap result = new LinkedHashMap();
+ result.put(key, value);
+ for (int i = 0; i < other.length - 1; i += 2) {
+ result.put(String.valueOf(other[i]), other[i + 1]);
+ }
+ return result;
+ }
private static class NoCompletionCandidates implements Iterable {
public Iterator iterator() { throw new UnsupportedOperationException(); }
@@ -3551,6 +3587,12 @@ public enum ScopeType {
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER})
public @interface Option {
+ /** Special value that can be used in some annotation attributes to designate {@code null}.
+ * @see Option#defaultValue()
+ * @see Option#fallbackValue()
+ * @see Option#mapFallbackValue()
+ * @since 4.6 */
+ public static final String NULL_VALUE = ArgSpec.NULL_VALUE;
/**
* One or more option names. At least one option name is required.
*
@@ -3814,6 +3856,9 @@ public enum ScopeType {
boolean hidden() default false;
/** Returns the default value of this option, before splitting and type conversion.
+ *
To get a {@code null} default value, omit specifying a default value or use the special value {@link Option#NULL_VALUE} -
+ * for options of type {@code Optional} that will result in the {@code Optional.empty()}
+ * value being assigned when the option is not specified on the command line.
* @return a String that (after type conversion) will be used as the value for this option if the option was not specified on the command line
* @see #fallbackValue()
* @since 3.2 */
@@ -3842,16 +3887,18 @@ public enum ScopeType {
*
*
* @return a class whose instances can iterate over the completion candidates for this option
- * @see CommandLine.IFactory
+ * @see picocli.CommandLine.IFactory
* @since 3.2 */
Class extends Iterable> completionCandidates() default NoCompletionCandidates.class;
/**
- * Set {@code interactive=true} if this option will prompt the end user for a value (like a password).
+ * Set {@code interactive=true} to make this option prompt the end user for a value (like a password).
* Only supported for single-value options and {@code char[]} arrays (no collections, maps or other array types).
- * When running on Java 6 or greater, this will use the {@link Console#readPassword()} API to get a value without echoing input to the console.
+ * When running on Java 6 or greater and {@link Option#echo() echo = false} (the default),
+ * this will use the {@link Console#readPassword()} API to get a value without echoing input to the console,
+ * otherwise it will simply read a value from {@code System.in}.
*
- * Best security practice is to use type {@code char[]} instead of {@code String}, and to to null out the array after use.
+ * For passwords, best security practice is to use type {@code char[]} instead of {@code String}, and to to null out the array after use.
*
* When defined with {@code arity = "0..1"}, the option can also take a value from the command line.
* (The user will still be prompted if no option parameter was specified on the command line.)
@@ -3862,6 +3909,22 @@ public enum ScopeType {
*/
boolean interactive() default false;
+ /** Use this attribute to control whether user input for an interactive option is echoed to the console or not.
+ * If {@code echo = true}, the user input is echoed to the console.
+ * This attribute is ignored when {@code interactive = false} (the default).
+ * @return whether the user input for an interactive option should be echoed to the console or not
+ * @see OptionSpec#echo()
+ * @since 4.6 */
+ boolean echo() default false;
+
+ /** Use this attribute to customize the text displayed to the end user for an interactive option when asking for user input.
+ * When omitted, the displayed text is derived from the option name and the first description line.
+ * This attribute is ignored when {@code interactive = false} (the default).
+ * @return the text to display to the end user for an interactive option when asking for user input
+ * @see OptionSpec#prompt()
+ * @since 4.6 */
+ String prompt() default "";
+
/** ResourceBundle key for this option. If not specified, (and a ResourceBundle {@linkplain Command#resourceBundle() exists for this command}) an attempt
* is made to find the option description using any of the option names (without leading hyphens) as key.
* @see OptionSpec#description()
@@ -3911,16 +3974,36 @@ public enum ScopeType {
*
This is useful to define options that can function as a boolean "switch"
* and optionally allow users to provide a (strongly typed) extra parameter value.
*
+ *
Use the special value {@link Option#NULL_VALUE} to specify {@code null} -
+ * for options of type {@code Optional} that will result in the {@code Optional.empty()}
+ * value being assigned when the option name is specified without a parameter on the command line.
* @see OptionSpec#fallbackValue()
* @since 4.0 */
String fallbackValue() default "";
+ /** For options of type Map, setting the {@code mapFallbackValue} to any value allows end user
+ * to specify key-only parameters for this option. For example, {@code -Dkey} instead of {@code -Dkey=value}.
+ *
The value specified in this annotation is the value that is put into the Map for the user-specified key.
+ * Use the special value {@link Option#NULL_VALUE} to specify {@code null} -
+ * for maps of type {@code Map>} that will result in {@code Optional.empty()}
+ * values in the map when only the key is specified.
+ *
If no {@code mapFallbackValue} is set, key-only Map parameters like {@code -Dkey}
+ * are considered invalid user input and cause a {@link ParameterException} to be thrown.
+ * @see ArgSpec#mapFallbackValue()
+ * @since 4.6 */
+ String mapFallbackValue() default ArgSpec.UNSPECIFIED;
+
/**
* Optionally specify a custom {@code IParameterConsumer} to temporarily suspend picocli's parsing logic
* and process one or more command line arguments in a custom manner.
* This may be useful when passing arguments through to another program.
* @since 4.0 */
Class extends IParameterConsumer> parameterConsumer() default NullParameterConsumer.class;
+
+ /** Returns the preprocessor for this option.
+ * @see IParameterPreprocessor
+ * @since 4.6 */
+ Class extends IParameterPreprocessor> preprocessor() default NoOpParameterPreprocessor.class;
}
/**
*
@@ -3950,6 +4033,11 @@ public enum ScopeType {
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER})
public @interface Parameters {
+ /** Special value that can be used in some annotation attributes to designate {@code null}.
+ * @see Parameters#defaultValue()
+ * @see Parameters#mapFallbackValue()
+ * @since 4.6 */
+ public static final String NULL_VALUE = ArgSpec.NULL_VALUE;
/** Specify an index ("0", or "1", etc.) to pick which of the command line arguments should be assigned to this
* field. For array or Collection fields, you can also specify an index range ("0..3", or "2..*", etc.) to assign
* a subset of the command line arguments to this field. The default is "*", meaning all command line arguments.
@@ -4070,6 +4158,9 @@ public enum ScopeType {
boolean hidden() default false;
/** Returns the default value of this positional parameter, before splitting and type conversion.
+ *
To get a {@code null} default value, omit specifying a default value or use the special value {@link Parameters#NULL_VALUE} -
+ * for positional parameters of type {@code Optional} that will result in the {@code Optional.empty()}
+ * value being assigned when the positional parameters is not specified on the command line.
* @return a String that (after type conversion) will be used as the value for this positional parameter if no value was specified on the command line
* @since 3.2 */
String defaultValue() default "__no_default_value__";
@@ -4092,19 +4183,38 @@ public enum ScopeType {
*
*
* @return a class whose instances can iterate over the completion candidates for this positional parameter
- * @see CommandLine.IFactory
+ * @see picocli.CommandLine.IFactory
* @since 3.2 */
Class extends Iterable> completionCandidates() default NoCompletionCandidates.class;
/**
* Set {@code interactive=true} if this positional parameter will prompt the end user for a value (like a password).
* Only supported for single-value positional parameters (not arrays, collections or maps).
- * When running on Java 6 or greater, this will use the {@link Console#readPassword()} API to get a value without echoing input to the console.
+ * When running on Java 6 or greater and {@link Option#echo() echo = false} (the default),
+ * this will use the {@link Console#readPassword()} API to get a value without echoing input to the console,
+ * otherwise it will simply read a value from {@code System.in}.
* @return whether this positional parameter prompts the end user for a value to be entered on the command line
* @since 3.5
*/
boolean interactive() default false;
+ /** Use this attribute to control whether user input for an interactive positional parameter is echoed to the console or not.
+ * If {@code echo = true}, the user input is echoed to the console.
+ * This attribute is ignored when {@code interactive = false} (the default).
+ * @return whether the user input for an interactive positional parameter should be echoed to the console or not
+ * @see PositionalParamSpec#echo()
+ * @since 4.6 */
+ boolean echo() default false;
+
+ /** Use this attribute to customize the text displayed to the end user for an interactive positional parameter when asking for user input.
+ * When omitted, the displayed text is derived from the positional parameter's
+ * position (index) and the first description line.
+ * This attribute is ignored when {@code interactive = false} (the default).
+ * @return the text to display to the end user for an interactive positional parameter when asking for user input
+ * @see PositionalParamSpec#prompt()
+ * @since 4.6 */
+ String prompt() default "";
+
/** ResourceBundle key for this option. If not specified, (and a ResourceBundle {@linkplain Command#resourceBundle() exists for this command}) an attempt
* is made to find the positional parameter description using {@code paramLabel() + "[" + index() + "]"} as key.
*
@@ -4123,6 +4233,23 @@ public enum ScopeType {
* and process one or more command line arguments in a custom manner.
* @since 4.0 */
Class extends IParameterConsumer> parameterConsumer() default NullParameterConsumer.class;
+
+ /** For positional parameters of type Map, setting the {@code mapFallbackValue} to any value allows end user
+ * to specify key-only parameters for this parameter. For example, {@code key} instead of {@code key=value}.
+ *
The value specified in this annotation is the value that is put into the Map for the user-specified key.
+ * Use the special value {@link Parameters#NULL_VALUE} to specify {@code null} -
+ * for maps of type {@code Map>} that will result in {@code Optional.empty()}
+ * values in the map when only the key is specified.
+ *
If no {@code mapFallbackValue} is set, key-only Map parameters like {@code -Dkey}
+ * are considered invalid user input and cause a {@link ParameterException} to be thrown.
+ * @see ArgSpec#mapFallbackValue()
+ * @since 4.6 */
+ String mapFallbackValue() default ArgSpec.UNSPECIFIED;
+
+ /** Returns the preprocessor for this positional parameter.
+ * @see IParameterPreprocessor
+ * @since 4.6 */
+ Class extends IParameterPreprocessor> preprocessor() default NoOpParameterPreprocessor.class;
}
/**
@@ -4563,28 +4690,28 @@ enum Target {
* @since 4.0 */
boolean usageHelpAutoWidth() default false;
- /** Exit code for successful termination. {@value CommandLine.ExitCode#OK} by default.
+ /** Exit code for successful termination. {@value picocli.CommandLine.ExitCode#OK} by default.
* @see #execute(String...)
* @since 4.0 */
int exitCodeOnSuccess() default ExitCode.OK;
- /** Exit code for successful termination after printing usage help on user request. {@value CommandLine.ExitCode#OK} by default.
+ /** Exit code for successful termination after printing usage help on user request. {@value picocli.CommandLine.ExitCode#OK} by default.
* @see #execute(String...)
* @since 4.0 */
int exitCodeOnUsageHelp() default ExitCode.OK;
- /** Exit code for successful termination after printing version help on user request. {@value CommandLine.ExitCode#OK} by default.
+ /** Exit code for successful termination after printing version help on user request. {@value picocli.CommandLine.ExitCode#OK} by default.
* @see #execute(String...)
* @since 4.0 */
int exitCodeOnVersionHelp() default ExitCode.OK;
- /** Exit code for command line usage error. {@value CommandLine.ExitCode#USAGE} by default.
+ /** Exit code for command line usage error. {@value picocli.CommandLine.ExitCode#USAGE} by default.
* @see #execute(String...)
* @since 4.0 */
int exitCodeOnInvalidInput() default ExitCode.USAGE;
/** Exit code signifying that an exception occurred when invoking the Runnable, Callable or Method user object of a command.
- * {@value CommandLine.ExitCode#SOFTWARE} by default.
+ * {@value picocli.CommandLine.ExitCode#SOFTWARE} by default.
* @see #execute(String...)
* @since 4.0 */
int exitCodeOnExecutionException() default ExitCode.SOFTWARE;
@@ -4605,6 +4732,19 @@ enum Target {
*
* @since 4.0 */
String[] exitCodeList() default {};
+
+ /** Returns whether subcommands inherit their attributes from this parent command.
+ * @since 4.6 */
+ ScopeType scope() default ScopeType.LOCAL;
+
+ /** Returns the model transformer for this command.
+ * @since 4.6 */
+ Class extends IModelTransformer> modelTransformer() default NoOpModelTransformer.class;
+
+ /** Returns the preprocessor for this command.
+ * @see IParameterPreprocessor
+ * @since 4.6 */
+ Class extends IParameterPreprocessor> preprocessor() default NoOpParameterPreprocessor.class;
}
/** A {@code Command} may define one or more {@code ArgGroups}: a group of options, positional parameters or a mixture of the two.
* Groups can be used to:
@@ -4723,7 +4863,14 @@ public interface ITypeConverter {
* Converts the specified command line argument value to some domain object.
* @param value the command line argument String value
* @return the resulting domain object
- * @throws Exception an exception detailing what went wrong during the conversion
+ * @throws Exception an exception detailing what went wrong during the conversion.
+ * Any exception thrown from this method will be caught and shown to the end user.
+ * An example error message shown to the end user could look something like this:
+ * {@code Invalid value for option '--some-option': cannot convert 'xxxinvalidinput' to SomeType (java.lang.IllegalArgumentException: Invalid format: must be 'x:y:z' but was 'xxxinvalidinput')}
+ * @throws TypeConversionException throw this exception to have more control over the error
+ * message that is shown to the end user when type conversion fails.
+ * An example message shown to the user could look like this:
+ * {@code Invalid value for option '--some-option': Invalid format: must be 'x:y:z' but was 'xxxinvalidinput'}
*/
K convert(String value) throws Exception;
}
@@ -4744,6 +4891,39 @@ private static class NoVersionProvider implements IVersionProvider {
public String[] getVersion() throws Exception { throw new UnsupportedOperationException(); }
}
+ /**
+ * Provides a way to modify how the command model is built.
+ * This is useful for applications that need to modify the model dynamically depending on the runtime environment.
+ *
+ * Commands may configure a model transformer using the
+ * {@link Command#modelTransformer()} annotation attribute, or via the
+ * {@link CommandSpec#modelTransformer(IModelTransformer)} programmatic API.
+ *
+ * Model transformers are invoked only once, after the full command hierarchy is constructed.
+ * @since 4.6
+ */
+ public interface IModelTransformer {
+ /**
+ * Given an original CommandSpec, return the object that should be used
+ * instead. Implementors may modify the specified CommandSpec and return it,
+ * or create a full or partial copy of the specified CommandSpec, and return
+ * that, or even return a completely new CommandSpec.
+ *
+ * Implementors are free to add or remove options, positional parameters,
+ * subcommands or modify the command in any other way.
+ *
+ * This method is called once, after the full command hierarchy is
+ * constructed, and before any command line arguments are parsed.
+ *
+ * @return the CommandSpec to use instead of the specified one
+ */
+ CommandSpec transform(CommandSpec commandSpec);
+ }
+
+ private static class NoOpModelTransformer implements IModelTransformer {
+ public CommandSpec transform(CommandSpec commandSpec) { return commandSpec; }
+ }
+
/**
* Provides default value for a command. Commands may configure a provider with the
* {@link Command#defaultValueProvider()} annotation attribute.
@@ -4827,6 +5007,129 @@ public interface IParameterConsumer {
private static class NullParameterConsumer implements IParameterConsumer {
public void consumeParameters(Stack args, ArgSpec argSpec, CommandSpec commandSpec) { throw new UnsupportedOperationException(); }
}
+ /**
+ * Options, positional parameters and commands can be assigned a {@code IParameterPreprocessor} that
+ * implements custom logic to preprocess the parameters for this option, position or command.
+ * When an option, positional parameter or command with a custom {@code IParameterPreprocessor} is matched
+ * on the command line, picocli's internal parser is temporarily suspended, and this custom logic is invoked.
+ *
+ * This custom logic may completely replace picocli's internal parsing for this option, positional parameter
+ * or command, or it may do some preprocessing before picocli's internal parsing is resumed for this option,
+ * positional parameter or command.
+ *
+ * The "preprocessing" can include modifying the stack of command line parameters, or modifying the model.
+ *
+ *
This may be useful when disambiguating input for commands that have both a positional parameter and an
+ * option with an optional parameter.
+ *
Example usage:
+ *
+ * @Command(name = "edit")
+ * class Edit {
+ * @Parameters(index = "0", description = "The file to edit.")
+ * File file;
+ *
+ * enum Editor { defaultEditor, eclipse, idea, netbeans }
+ *
+ * @Option(names = "--open", arity = "0..1", preprocessor = Edit.MyPreprocessor.class,
+ * description = {
+ * "Optionally specify the editor to use; if omitted the default editor is used. ",
+ * "Example: edit --open=idea FILE opens IntelliJ IDEA (notice the '=' separator)",
+ * " edit --open FILE opens the specified file in the default editor"
+ * })
+ * Editor editor = Editor.defaultEditor;
+ *
+ * static class MyPreprocessor implements IParameterPreprocessor {
+ * public boolean preprocess(Stack<String> args, CommandSpec commandSpec, ArgSpec argSpec, Map<String, Object> info) {
+ * // we need to decide whether the next arg is the file to edit or the name of the editor to use...
+ * if (" ".equals(info.get("separator"))) { // parameter was not attached to option
+ * args.push(Editor.defaultEditor.name()); // act as if the user specified --open=defaultEditor
+ * }
+ * return false; // picocli's internal parsing is resumed for this option
+ * }
+ * }
+ * }
+ * @see Option#preprocessor()
+ * @see Parameters#preprocessor()
+ * @since 4.6 */
+ public interface IParameterPreprocessor {
+ /**
+ * Called when either the command, option or positional parameter that has this preprocessor configured was
+ * recognized by the picocli parser.
+ *
Implementors are free to modify one or more of the specified command line arguments before they are
+ * processed by the picocli parser (or by the option's {@link IParameterConsumer parameter consumer}, if one is specified).
+ *
+ * Implementors may optionally consume one or more of the specified command line arguments:
+ * a return value of {@code true} signals that the preprocessor consumed the parameter:
+ * picocli should skip further processing of this option or positional parameter,
+ * and the preprocessor implementation takes responsibility for assigning the
+ * option or positional parameter a value. A return value of {@code false} means that picocli should
+ * process the stack as usual for this option or positional parameter, and picocli is responsible for
+ * assigning this option or positional parameter a value.
+ *
+ * For a command, returning {@code true} signals that the preprocessor takes responsibility for parsing all
+ * options and positional parameters for this command, and takes responsibility for validating constraints like
+ * whether all required options and positional parameters were specified.
+ * A return value of {@code false} means that picocli should
+ * process the stack as usual for this command, and picocli is responsible for validation.
+ * Command preprocessors can signal back to the picocli parser when they detect that the user requested version
+ * information or usage help by putting a value of {@code true} in the specified
+ * {@code info} map for keys {@code versionHelpRequested} or {@code usageHelpRequested}, respectively.
+ *
+ * If the user input is invalid, implementations should throw a {@link ParameterException}
+ * with a message to display to the user.
+ *
+ * @param args the remaining command line arguments that follow the matched argument
+ * (the matched argument is not on the stack anymore)
+ * @param commandSpec the command or subcommand that was matched (if the specified {@code argSpec} is
+ * {@code null}), or the command that the matched option or positional parameter belongs to
+ * @param argSpec the option or positional parameter for which to pre-process command line arguments
+ * (may be {@code null} when this method is called for a subcommand that was matched)
+ * @param info a map containing additional information on the current parser state,
+ * including whether the option parameter was attached to the option name with
+ * a `=` separator, whether quotes have already been stripped off the option, etc.
+ * Implementations may modify this map to communicate back to the picocli parser.
+ * Supported values:
+ *
+ *
+ *
key
valid values
type
+ *
+ *
+ *
separator
'' (empty string): attached without separator, ' ' (space): not attached, (any other string): option name was attached to option param with specified separator
+ *
java.lang.String
+ *
+ *
+ *
negated
+ *
{@code true}: the option or positional parameter is a {@linkplain Option#negatable() negated} option/parameter, {@code false}: the option or positional parameter is not a negated option/parameter
+ *
java.lang.Boolean
+ *
+ *
+ *
unquoted
+ *
{@code true}: quotes surrounding the value have already been stripped off, {@code false}: quotes surrounding the value have not yet been stripped off
+ *
java.lang.Boolean
+ *
+ *
+ *
versionHelpRequested
+ *
{@code true}: version help was requested, {@code false}: version help was not requested
+ *
java.lang.Boolean
+ *
+ *
+ *
usageHelpRequested
+ *
{@code true}: usage help was requested, {@code false}: usage help was not requested
+ *
java.lang.Boolean
+ *
+ *
+ * @returns true if the preprocessor consumed the parameter
+ * and picocli should skip further processing of the stack for this option or positional parameter;
+ * false if picocli should continue processing the stack for this option or positional parameter
+ * @throws ParameterException if the user input is invalid
+ */
+ boolean preprocess(Stack args, CommandSpec commandSpec, ArgSpec argSpec, Map info);
+ }
+ private static class NoOpParameterPreprocessor implements IParameterPreprocessor {
+ public boolean preprocess(Stack args, CommandSpec commandSpec, ArgSpec argSpec, Map info) { return false; }
+ public boolean equals(Object obj) { return obj instanceof NoOpParameterPreprocessor; }
+ public int hashCode() { return NoOpParameterPreprocessor.class.hashCode() + 7; }
+ }
/** Determines the option name transformation of {@linkplain Option#negatable() negatable} boolean options.
* Making an option negatable has two aspects:
@@ -4863,7 +5166,7 @@ public interface INegatableOptionTransformer {
* "Boolean options are turned on with {@code -XX:+