anchor.diff:  === Spring Boot Example
   image:https://picocli.info/images/spring-boot.png[Spring Boot Logo,width=350,height=167]
   
  -As of version 4.0, picocli provides a custom factory in the `picocli-spring-boot-starter` module.
  -To use this custom factory, add the following dependency:
  -
  -Maven:
  -```xml
  +As of version 4.0, picocli comes with Spring Boot support by providing a custom factory in the `picocli-spring-boot-starter` module.
  +
  +The Spring Boot example app below provides a command line interface to a mail client that can be used to send emails using an SMTP server.
  +The `To` address(es) and the subject line can be given as options, while a message body can be specified as parameter text.
  +
  +To get started, visit the https://start.spring.io/#!type=maven-project&language=java&platformVersion=2.3.5.RELEASE&packaging=jar&jvmVersion=11&groupId=info.picocli&artifactId=examples&name=spring-boot-demo&description=Demo%20project%20for%20Spring%20Boot%20with%20Picocli%20support&packageName=info.picocli.examples&dependencies=mail[Spring Initializr] first.
  +Our example app has `Java Mail Sender` as dependency, please note that this dependency is selected already.
  +Review all settings, and change if needed, especially if you want to code your app in Kotlin.
  +By clicking on the button `Generate` you can download a self-contained skeleton Spring Boot project, together with its dependencies, a build script and test cases.
  +Extract the archive file to a directory of your choice and open a shell or command prompt for this directory.
  +
  +Since picocli dependencies are not available in the Spring Initializr, we have to add them manually:
  +
  +.Maven
  +[source,xml,role="primary"]
  +----
  +<dependency>
   <dependency>
     <groupId>info.picocli</groupId>
     <artifactId>picocli-spring-boot-starter</artifactId>
     <version>4.5.3-SNAPSHOT</version>
   </dependency>
  -```
  -
  -Gradle:
  -```
  +----
  +.Gradle (Groovy)
  +[source,groovy,role="secondary"]
  +----
   dependencies {
  -    compile "info.picocli:picocli-spring-boot-starter:4.5.3-SNAPSHOT"
  -}
  -```
  -
  -This will bring in the `info.picocli:picocli` and `org.springframework.boot:spring-boot-starter` dependencies.
  -
  -The below example shows how to use picocli with Spring Boot:
  -
  -.Java
  -[source,java,role="primary"]
  -----
  -import org.springframework.boot.CommandLineRunner;
  -import org.springframework.boot.ExitCodeGenerator;
  +    implementation 'info.picocli:picocli-spring-boot-starter:4.5.3-SNAPSHOT'
  +}
  +----
  +.Gradle (Kotlin)
  +[source,kotlin,role="secondary"]
  +----
  +dependencies {
  +    implementation("info.picocli:picocli-spring-boot-starter:4.5.3-SNAPSHOT")
  +}
  +----
  +
  +This will bring in the `info.picocli:picocli` and the `info.picocli:picocli-spring-boot-starter` dependencies.
  +
  +Now open the pre-authored source file `SpringBootDemoApplication.java`, rename it to MySpringMailer.java and edit and extend it so that it looks like this:
  +
  +.Java
  +[source,java,role="primary"]
  +----
  +import org.springframework.boot.*;
   import org.springframework.boot.autoconfigure.SpringBootApplication;
  -import org.springframework.boot.SpringApplication;
   import picocli.CommandLine;
   import picocli.CommandLine.IFactory;
   
   @SpringBootApplication
  -public class MySpringApp implements CommandLineRunner, ExitCodeGenerator {
  -
  -    private IFactory factory;    // auto-configured to inject PicocliSpringFactory
  -    private MyCommand myCommand; // your @picocli.CommandLine.Command-annotated class
  +public class MySpringMailer implements CommandLineRunner, ExitCodeGenerator {
  +
  +    private IFactory factory;        // <1>
  +    private MailCommand mailCommand; // <2>
       private int exitCode;
   
       // constructor injection
  -    MySpringApp(IFactory factory, MyCommand myCommand) {
  +    MySpringMailer(IFactory factory, MailCommand mailCommand) {
           this.factory = factory;
  -        this.myCommand = myCommand;
  +        this.mailCommand = mailCommand;
       }
   
       @Override
       public void run(String... args) {
           // let picocli parse command line args and run the business logic
  -        exitCode = new CommandLine(myCommand, factory).execute(args);
  +        exitCode = new CommandLine(mailCommand, factory).execute(args);
       }
   
       @Override
  
positive.code: === Quarkus Example
  image:https://quarkus.io/assets/images/quarkus_logo_horizontal_rgb_600px_reverse.png[Quarkus Logo,width=350,bg=black]
  
  Quarkus 1.5 added support for https://quarkus.io/guides/picocli#simple-command-line-application[Picocli Command Mode] applications, which allows to use Picoli in Quarkus applications easily.
  
  The Quarkus example app below provides a command line interface to a mail client that can be used to send emails using an SMTP server.
  `From` and `To` addresses have to be given as options, while a message body can be specified as parameter text.
  
negative.code:   header  adding custom header line(s)
  ----
  
  Since we specified no command line arguments, Picocli complains about the missing required options `--from` and `--to` and outputs the usage help.
  We have to pass in command line arguments into our command line call, we can use `-Dquarkus.args=our_values` for that purpose:
  
  ----
  