anchor.diff:  ----
   
   See also the https://github.com/remkop/picocli/tree/master/picocli-examples/src/main/java/picocli/examples/logging[logging] example in `picocli-examples` for a way to modify only the Log4j ConsoleAppenders' log level from the specified verbosity.
  +
  +
  +=== Use Case: Sharing Options
  +
  +A common use case is sharing options between different levels of the command hierarchy, so that "global" options from the top-level command are also available on subcommands.
  +
  +Since picocli 4.2, <<_parentcommand_annotation,`@ParentCommand`-annotated>> fields can be used in mixins, which makes this easier. Here is an example implementation:
  +
  +[source,java]
  +----
  +// Define a mixin that delegates to the parent command.
  +class MyMixin {
  +    @ParentCommand Top top;
  +
  +    @Option(names = "-v")
  +    public void setVerbose(boolean[] verbosity) { top.setVerbose(verbosity); }
  +}
  +
  +// An example Top-level command with two subcommands.
  +// The `-v` option can be specified on the top-level command as well as the subcommands.
  +@Command(subcommands = Sub2.class)
  +class Top implements Runnable {
  +    private boolean[] verbosity = new boolean[0];
  +
  +    @Option(names = {"-v", "--verbose"})
  +    public void setVerbose(boolean[] verbosity) { this.verbosity = verbosity; }
  +
  +    public void verbose(String pattern, Object... params) {
  +        if (verbosity.length >= 1) {
  +            System.out.printf(pattern, params);
  +        }
  +    }
  +
  +    public void run() { verbose("Hello from top%n"); }
  +
  +    public static void main(String[] args) {
  +        new CommandLine(new Top()).execute(args);
  +    }
  +
  +    // The @Mixin-annotated parameter adds the `-v` option to this subcommand.
  +    @Command
  +    void sub1(@Mixin MyMixin mymixin) { verbose("Hello from sub1%n"); }
  +}
  +
  +// Subcommand classes can mix in the `-v` option with a @Mixin-annotated field.
  +@Command(name = "sub2")
  +class Sub2 implements Runnable{
  +    @Mixin MyMixin mymixin;
  +
  +    @Override
  +    public void run() { mymixin.top.verbose("Hello from sub2%n"); }
  +}
  +----
  +
  +With this, the `-v` option can be specified on the top-level command as well as the subcommands, so all of the below are valid invocations:
  +
  +----
  +java Top -v
  +java Top -v sub1
  +java Top sub1 -v
  +java Top -v sub2
  +java Top sub2 -v
  +----
  +
  +All of these invocations will print some output, since the `-v` option was specified.
   
   === Reuse Combinations
   
  
positive.code: Picocli's <<Mixin Standard Help Options,mixinStandardHelpOptions>> internally uses a mixin.
  
  A mixin is a separate class with options, positional parameters, subcommands and command attributes that you want to reuse in one or more other commands.
  A command receiving these mixed in options, positional parameters, and command attributes is called a "mixee".
  
  Mixins can be installed declaratively with a `@Mixin`-annotated field (or a `@Mixin`-annotated method parameter for command methods).
  Alternatively, mixins can be installed programmatically by calling the `CommandLine.addMixin` method with an instance of the mixin class.
  
negative.code: 
  In the above example, the `-x` and `-y` options are added to the other options of the `doit` command.
  
  [#spec-annotation]
  === `@Spec` Annotation
  Picocli 3.2 introduces a `@Spec` annotation for injecting the `CommandSpec` model of the command into a command field.
  
  