<H1> picocli - a mighty tiny command line interface </H1> |
<H2> 1. Introduction </H2> |
<H2> 2. Getting Started </H2> |
<H2> 3. Options and Parameters </H2> |
<H2> 4. Strongly Typed Everything </H2> |
<H2> 5. Default Values </H2> |
<H2> 6. Multiple Values </H2> |
<H2> 7. Required Arguments </H2> |
<H2> 8. Argument Groups </H2> |
<H2> 9. Executing Commands </H2> |
<H2> 10. Validation </H2> |
<H2> 11. Parser Configuration </H2> |
<H2> 12. Help </H2> |
<H2> 13. Version Help </H2> |
<H2> 14. Usage Help </H2> |
<H2> 15. ANSI Colors and Styles </H2> |
<H2> 16. Usage Help API </H2> |
<H2> 17. Subcommands </H2> |
<H2> 18. Reuse </H2> |
<H2> 19. Internationalization </H2> |
<H2> 20. Variable Interpolation </H2> |
<H2> 21. Tips & Tricks </H2> |
<H2> 22. Dependency Injection </H2> |
<H2> 23. Java 9 JPMS Modules </H2> |
<H2> 24. OSGi Bundle </H2> |
<H2> 25. Tracing </H2> |
<H2> 26. TAB Autocomplete </H2> |
<H2> 27. Generate Man Page Documentation </H2> |
<H2> 28. Testing Your Application </H2> |
<H2> 29. Packaging Your Application </H2> |
<H2> 30. Picocli in Other Languages </H2> |
<H2> 31. API Javadoc </H2> |
<H2> 32. GitHub Project </H2> |
<H2> 33. Issue Tracker </H2> |
<H2> 34. Mailing List </H2> |
<H2> 35. License </H2> |
<H2> 36. Releases </H2> |
<H2> 37. Download </H2> |
<H3> 1.1. Overview </H3> |
<H3> 1.2. Example application </H3> |
<H3> 2.1. Add as External Dependency </H3> |
<H3> 2.2. Add as Source </H3> |
<H3> 2.3. Annotation Processor </H3> |
<H3> 2.4. Running the Application </H3> |
<H3> 3.1. Options </H3> |
<H3> 3.2. Interactive (Password) Options </H3> |
<H3> 3.3. Short (POSIX) Options </H3> |
<H3> 3.4. Boolean Options </H3> |
<H3> 3.5. Negatable Options </H3> |
<H3> 3.6. Positional Parameters </H3> |
<H3> 3.7. Mixing Options and Positional Parameters </H3> |
<H3> 3.8. Double dash (--) </H3> |
<H3> 3.9. @-files </H3> |
<H3> 4.1. Built-in Types </H3> |
<H3> 4.2. Custom Type Converters </H3> |
<H3> 4.3. Handling Invalid Input </H3> |
<H3> 4.4. Option-specific Type Converters </H3> |
<H3> 4.5. Arrays, Collections, Maps </H3> |
<H3> 4.6. Optional </H3> |
<H3> 4.7. Abstract Field Types </H3> |
<H3> 4.8. Enum Types </H3> |
<H3> 5.1. defaultValue Annotation </H3> |
<H3> 5.2. Field Values </H3> |
<H3> 5.3. Default Provider </H3> |
<H3> 5.4. PropertiesDefaultProvider </H3> |
<H3> 5.5. fallbackValue Annotation </H3> |
<H3> 5.6. Was a Value Defaulted? </H3> |
<H3> 6.1. Multiple Occurrences </H3> |
<H3> 6.2. Split Regex </H3> |
<H3> 6.3. Arity </H3> |
<H3> 6.4. Variable Arity Limitations </H3> |
<H3> 6.5. Default Arity </H3> |
<H3> 6.6. Optional Values </H3> |
<H3> 7.1. Required Options </H3> |
<H3> 7.2. Required Parameters </H3> |
<H3> 7.3. Options with an Optional Parameter </H3> |
<H3> 8.1. Mutually Exclusive Options </H3> |
<H3> 8.2. Mutually Dependent Options </H3> |
<H3> 8.3. Option Sections in Usage Help </H3> |
<H3> 8.4. Repeating Composite Argument Groups </H3> |
<H3> 8.5. Default Values in Argument Groups </H3> |
<H3> 8.6. Positional Parameters </H3> |
<H3> 8.7. Argument Group Limitations </H3> |
<H3> 9.1. Exit Code </H3> |
<H3> 9.2. Generating an Exit Code </H3> |
<H3> 9.3. Exception Exit Codes </H3> |
<H3> 9.4. Usage Help Exit Code Section </H3> |
<H3> 9.5. Execution Configuration </H3> |
<H3> 9.6. Migration </H3> |
<H3> 9.7. DIY Command Execution </H3> |
<H3> 9.8. Handling Errors </H3> |
<H3> 10.1. Built-in Validation </H3> |
<H3> 10.2. Custom Validation </H3> |
<H3> 11.1. Case Sensitivity </H3> |
<H3> 11.2. Abbreviated Options and Subcommands </H3> |
<H3> 11.3. Overwriting Single Options </H3> |
<H3> 11.4. Stop At Positional </H3> |
<H3> 11.5. Stop At Unmatched </H3> |
<H3> 11.6. Unmatched Input </H3> |
<H3> 11.7. @Unmatched annotation </H3> |
<H3> 11.8. Unknown Options </H3> |
<H3> 11.9. Option names as Option Values </H3> |
<H3> 11.10. Toggle Boolean Flags </H3> |
<H3> 11.11. POSIX Clustered Short Options </H3> |
<H3> 11.12. Lenient Mode </H3> |
<H3> 11.13. Quoted Values </H3> |
<H3> 11.14. Customizing Negatable Options </H3> |
<H3> 11.15. Custom Parameter Processing </H3> |
<H3> 12.1. Help Options </H3> |
<H3> 12.2. Mixin Standard Help Options </H3> |
<H3> 12.3. Built-in Help Subcommand </H3> |
<H3> 12.4. Custom Help Subcommands </H3> |
<H3> 12.5. Printing Help Automatically </H3> |
<H3> 13.1. Static Version Information </H3> |
<H3> 13.2. Dynamic Version Information </H3> |
<H3> 14.1. Compact Example </H3> |
<H3> 14.2. Command name </H3> |
<H3> 14.3. Parameter Labels </H3> |
<H3> 14.4. Unsorted Option List </H3> |
<H3> 14.5. Reordering Options </H3> |
<H3> 14.6. Split Synopsis Label </H3> |
<H3> 14.7. Abbreviated Synopsis </H3> |
<H3> 14.8. Custom Synopsis </H3> |
<H3> 14.9. Synopsis Subcommand Label </H3> |
<H3> 14.10. Header and Footer </H3> |
<H3> 14.11. Exit Code List </H3> |
<H3> 14.12. Format Specifiers </H3> |
<H3> 14.13. Section Headings </H3> |
<H3> 14.14. Expanded Example </H3> |
<H3> 14.15. Option-Parameter Separators </H3> |
<H3> 14.16. Hidden Options and Parameters </H3> |
<H3> 14.17. Show At Files </H3> |
<H3> 14.18. Show End of Options </H3> |
<H3> 14.19. Show Default Values </H3> |
<H3> 14.20. Required-Option Marker </H3> |
<H3> 14.21. Usage Width </H3> |
<H3> 14.22. Auto (Terminal) Width </H3> |
<H3> 14.23. Long Option Column Width </H3> |
<H3> 15.1. Colorized Example </H3> |
<H3> 15.2. Usage Help with Styles and Colors </H3> |
<H3> 15.3. Styles and Colors in Application Output </H3> |
<H3> 15.4. More Colors </H3> |
<H3> 15.5. Configuring Fixed Elements </H3> |
<H3> 15.6. Supported Platforms </H3> |
<H3> 15.7. Forcing ANSI On/Off </H3> |
<H3> 15.8. Heuristics for Enabling ANSI </H3> |
<H3> 16.1. Reordering Sections </H3> |
<H3> 16.2. Custom Layout </H3> |
<H3> 17.1. Subcommand Examples </H3> |
<H3> 17.2. Registering Subcommands Declaratively </H3> |
<H3> 17.3. Subcommands as Methods </H3> |
<H3> 17.4. Registering Subcommands Programmatically </H3> |
<H3> 17.5. Executing Subcommands </H3> |
<H3> 17.6. Initialization Before Execution </H3> |
<H3> 17.7. @ParentCommand Annotation </H3> |
<H3> 17.8. Subcommand Aliases </H3> |
<H3> 17.9. Inherited Command Attributes </H3> |
<H3> 17.10. Inherited Options </H3> |
<H3> 17.11. Manually Parsing Subcommands </H3> |
<H3> 17.12. Nested sub-Subcommands </H3> |
<H3> 17.13. Repeatable Subcommands </H3> |
<H3> 17.14. Usage Help for Subcommands </H3> |
<H3> 17.15. Hidden Subcommands </H3> |
<H3> 17.16. Help Subcommands </H3> |
<H3> 17.17. Required Subcommands </H3> |
<H3> 18.1. Subclassing </H3> |
<H3> 18.2. Mixins </H3> |
<H3> 18.3. Inherited Scope </H3> |
<H3> 18.4. Use Case: Configure Log Level with a Global Option </H3> |
<H3> 18.5. Sharing Options in Subcommands </H3> |
<H3> 18.6. Reuse Combinations </H3> |
<H3> 19.1. Configuration </H3> |
<H3> 19.2. Example Resource Bundle </H3> |
<H3> 19.3. Shared Resource Bundles </H3> |
<H3> 19.4. Localizing the Built-In Help </H3> |
<H3> 19.5. Localizing Default Values </H3> |
<H3> 20.1. Variable Interpolation Example </H3> |
<H3> 20.2. Predefined Variables </H3> |
<H3> 20.3. Custom Variables </H3> |
<H3> 20.4. Default Values for Custom Variables </H3> |
<H3> 20.5. Escaping Variables </H3> |
<H3> 20.6. Switching Off Variable Interpolation </H3> |
<H3> 20.7. Limitations of Variable Interpolation </H3> |
<H3> 21.1. Programmatic API </H3> |
<H3> 21.2. @Option and @Parameters Methods </H3> |
<H3> 21.3. @Command Methods </H3> |
<H3> 21.4. @Spec Annotation </H3> |
<H3> 21.5. Custom Factory </H3> |
<H3> 21.6. Model Transformations </H3> |
<H3> 21.7. Automatic Parameter Indexes </H3> |
<H3> 21.8. Improved Support for Chinese, Japanese and Korean </H3> |
<H3> 21.9. Boolean Options with Parameters </H3> |
<H3> 21.10. Hexadecimal Values </H3> |
<H3> 21.11. Option-Parameter Separators </H3> |
<H3> 21.12. Best Practices for Command Line Interfaces </H3> |
<H3> 21.13. Text Blocks for Java 15 </H3> |
<H3> 22.1. Guice Example </H3> |
<H3> 22.2. Spring Boot Example </H3> |
<H3> 22.3. Micronaut Example </H3> |
<H3> 22.4. Quarkus Example </H3> |
<H3> 22.5. CDI 2.0 (JSR 365) </H3> |
<H3> 23.1. Module Configuration </H3> |
<H3> 28.1. Black Box and White Box Testing </H3> |
<H3> 28.2. Testing the Output </H3> |
<H3> 28.3. Testing the Exit Code </H3> |
<H3> 28.4. Testing Environment Variables </H3> |
<H3> 28.5. Mocking </H3> |
<H3> 29.1. Alias </H3> |
<H3> 29.2. Launcher Script </H3> |
<H3> 29.3. GraalVM Native Image </H3> |
<H3> 29.4. Really Executable JAR </H3> |
<H3> 29.5. launch4j </H3> |
<H3> 29.6. javapackager (Java 8) </H3> |
<H3> 29.7. jlink (Java 9+) </H3> |
<H3> 29.8. jpackage </H3> |
<H3> 29.9. jbang </H3> |
<H3> 30.1. Groovy </H3> |
<H3> 30.2. Kotlin </H3> |
<H3> 30.3. Scala </H3> |
<H3> 37.1. Build tools </H3> |
<H3> 37.2. Source </H3> |
<H4> 2.3.1. Processor option: project </H4> |
<H4> 2.3.2. Enabling the Annotation Processor </H4> |
<H4> 3.2.1. Example </H4> |
<H4> 3.2.2. Optionally Interactive </H4> |
<H4> 3.6.1. Explicit Index </H4> |
<H4> 3.6.2. Omitting the Index </H4> |
<H4> 3.9.1. Argument Files for Long Command Lines </H4> |
<H4> 3.9.2. @-files Usage Help </H4> |
<H4> 3.9.3. Simplified Format </H4> |
<H4> 4.2.1. Single Parameter Type Converters </H4> |
<H4> 4.2.2. Multi Parameter Type Converters </H4> |
<H4> 4.5.1. Arrays and Collections </H4> |
<H4> 4.5.2. Maps </H4> |
<H4> 4.5.3. Key-only map parameters </H4> |
<H4> 4.5.4. System Properties </H4> |
<H4> 4.7.1. Maps and Collections with Abstract Elements </H4> |
<H4> 5.4.1. PropertiesDefaultProvider Format </H4> |
<H4> 5.4.2. Subcommands Default Values </H4> |
<H4> 6.1.1. Repeated Options </H4> |
<H4> 6.1.2. Multiple Positional Parameters </H4> |
<H4> 6.1.3. Repeated Boolean Options </H4> |
<H4> 6.4.1. Variable Arity Options and Unknown Options </H4> |
<H4> 6.4.2. Variable Arity Options and Positional Parameters </H4> |
<H4> 6.5.1. Option Arity </H4> |
<H4> 6.5.2. Positional Parameter Arity </H4> |
<H4> 6.6.1. Optional Option Parameters </H4> |
<H4> 6.6.2. Optional Parameter Use Cases </H4> |
<H4> 6.6.3. Optional Parameter Limitations </H4> |
<H4> 8.2.1. Overview </H4> |
<H4> 8.2.2. Non-Required Options in Mutually Dependent Groups </H4> |
<H4> 8.3.1. Use Heading to Enable Option Sections </H4> |
<H4> 8.3.2. Option Section Order </H4> |
<H4> 8.5.1. Default Values in Group Usage Help </H4> |
<H4> 9.6.1. Customizing Output Streams and ANSI settings </H4> |
<H4> 9.6.2. Return Value from Callable or Method </H4> |
<H4> 9.6.3. Invoking Command Methods </H4> |
<H4> 9.6.4. Executing Commands with Subcommands </H4> |
<H4> 9.8.1. Invalid User Input </H4> |
<H4> 9.8.2. Business Logic Exceptions </H4> |
<H4> 10.2.1. Single Value Validation </H4> |
<H4> 10.2.2. Validating Option Combinations </H4> |
<H4> 10.2.3. JSR-380 BeanValidation </H4> |
<H4> 11.2.1. Recognized Abbreviations </H4> |
<H4> 11.2.2. Ambiguous Abbreviations </H4> |
<H4> 11.2.3. Abbreviated Long Options and POSIX Clustered Short Options </H4> |
<H4> 11.8.1. Unknown Options Definition </H4> |
<H4> 11.8.2. Positional Parameters Resembling Options </H4> |
<H4> 11.8.3. Option Parameters Resembling Options </H4> |
<H4> 11.13.1. Trimming Quotes </H4> |
<H4> 11.13.2. Splitting Quoted Parameters </H4> |
<H4> 11.15.1. IParameterConsumer Parser Plugin </H4> |
<H4> 11.15.2. IParameterPreprocessor Parser Plugin </H4> |
<H4> 11.15.3. Parser Plugin Comparison </H4> |
<H4> 13.1.1. Command version Attribute </H4> |
<H4> 13.1.2. Multi-line Version Info </H4> |
<H4> 13.1.3. Version Info With Variables </H4> |
<H4> 13.1.4. Version Info With Colors </H4> |
<H4> 13.1.5. Version Info With Format Specifiers </H4> |
<H4> 13.2.1. Command versionProvider Attribute </H4> |
<H4> 13.2.2. IVersionProvider Interface </H4> |
<H4> 13.2.3. Dynamic Version Info with Variables </H4> |
<H4> 13.2.4. Injecting CommandSpec Into a IVersionProvider </H4> |
<H4> 14.17.1. Example </H4> |
<H4> 14.17.2. Changing the At File Entry Location </H4> |
<H4> 14.17.3. Changing the At File Entry Text </H4> |
<H4> 14.18.1. Example </H4> |
<H4> 14.18.2. Changing the End of Options Entry Location </H4> |
<H4> 14.18.3. Changing the End of Options Entry Text </H4> |
<H4> 14.19.1. ${DEFAULT-VALUE} Variable </H4> |
<H4> 14.19.2. ${COMPLETION-CANDIDATES} Variable </H4> |
<H4> 14.19.3. Legacy Configuration for Displaying Default Values </H4> |
<H4> 15.5.1. Color Scheme </H4> |
<H4> 15.5.2. Color Scheme Overrides </H4> |
<H4> 15.6.1. Unix and Linux </H4> |
<H4> 15.6.2. Windows </H4> |
<H4> 16.1.1. Custom Help Section Example </H4> |
<H4> 17.13.1. Example </H4> |
<H4> 17.13.2. Repeatable Subcommands Specification </H4> |
<H4> 17.13.3. Repeatable Subcommands Execution </H4> |
<H4> 18.2.1. @Mixin Annotation </H4> |
<H4> 18.2.2. Mixin Example: Logger </H4> |
<H4> 18.2.3. Accessing the Mixee from a Mixin </H4> |
<H4> 18.2.4. Accessing the Parent Command from a Mixin </H4> |
<H4> 18.2.5. Adding Mixins Programmatically </H4> |
<H4> 21.2.1. Annotating Methods of an Interface </H4> |
<H4> 21.2.2. Annotating Methods of a Concrete Class </H4> |
<H4> 21.3.1. Subcommand Methods </H4> |
<H4> 21.3.2. description Text in ResourceBundle </H4> |
<H4> 21.3.3. Mixin Support in @Command Methods </H4> |
<H4> 21.4.1. @Spec(MIXEE) Annotation </H4> |
<H4> 21.7.1. Automatic Indexes </H4> |
<H4> 21.7.2. Anchored Automatic Index </H4> |
<H4> 21.7.3. Combining Explicit and Automatic Indexes </H4> |
<H4> 21.7.4. Unanchored Automatic Index </H4> |
<H4> 21.7.5. Do Not Combine Unanchored Indexes with Open-ended Indexes </H4> |
<H4> 21.11.1. Default Separators </H4> |
<H4> 21.11.2. Custom Separators </H4> |
<H4> 28.5.1. Mocking subcommands with Mockito </H4> |
<H4> 29.3.1. What are GraalVM Native Images? </H4> |
<H4> 29.3.2. How do I Create a Native Image for my Application? </H4> |
<H4> 29.3.3. Where can I get More Details? </H4> |
<H4> 30.1.1. Groovy Annotation Syntax </H4> |
<H4> 30.1.2. Groovy Scripts </H4> |
<H4> 30.1.3. Closures in Annotations </H4> |
<H4> 30.1.4. Older Versions of Groovy </H4> |
<H4> 30.2.1. Kotlin Annotation Syntax </H4> |
<H4> 30.2.2. Older Versions of Kotlin </H4> |
<H5> IDE </H5> |
<H5> Using Build Tools </H5> |
<H5> Kotlin Projects Using Gradle </H5> |
<H5> Smart Unquote </H5> |
<H5> Example use case </H5> |
<H5> Jansi </H5> |
<H5> Jansi in GraalVM Native Images </H5> |
<H5> For Reference: Without Jansi on Windows 10 Command Console and PowerShell </H5> |
<H5> For Reference: Windows Subsystem for Linux (WSL) </H5> |
<H5> For Reference: 3rd Party Software </H5> |
Social
Social Data
Cost and overhead previously rendered this semi-public form of communication unfeasible.
But advances in social networking technology from 2004-2010 has made broader concepts of sharing possible.