diff --git a/RELEASE-NOTES.md b/RELEASE-NOTES.md index d9cdea79..8dc90010 100644 --- a/RELEASE-NOTES.md +++ b/RELEASE-NOTES.md @@ -23,7 +23,7 @@ Picocli follows [semantic versioning](http://semver.org/). * [New and noteworthy](#4.2.0-new) * [Repeatable Subcommands](#4.2.0-repeatable-subcommands) * [Inject `CommandSpec` into a `IVersionProvider`](#4.2.0-versionprovider-with-spec) - * [Lazily instantiate subcommands](#4.2.0-lazy-instantiation) + * [Subcommands are now lazily instantiated](#4.2.0-lazy-instantiation) * [Mixins with `@ParentCommand`-annotated fields](#4.2.0-mixins) * [Showing `@filename` in usage help](#4.2.0-atfiles-usage) * [Fixed issues](#4.2.0-fixes) @@ -74,7 +74,7 @@ This invocation is valid because `myapp` is marked with `subcommandsRepeatable = #### Repeatable Subcommands Specification Normally, `subcommandsRepeatable` is `false`, so for each command, only one of its subcommands can be specified, potentially followed by only one sub-subcommand of that subcommand, etc. -In mathematical terms, a valid sequence of commands and subcommands can be represented by a _directed rooted tree_ that starts at the top-level command, illustrated by the diagram below. +In mathematical terms, a valid sequence of commands and subcommands can be represented by a _directed rooted tree_ that starts at the top-level command. This is illustrated by the diagram below. ![subcommands not repeatable](https://picocli.info/images/subcommands-non-repeatable.png) @@ -83,7 +83,7 @@ Also, a subcommand can be followed by a "sibling" command (another command with In mathematical terms, when a parent command has this property, the additional valid sequences of its subcommands form a fully connected subgraph (_a complete digraph_). -The blue dotted arrows in the diagram below illustrate the additional sequences that are allowed when a command has repeatable subcommands. +The blue and green dotted arrows in the diagram below illustrate the additional sequences that are allowed when a command has repeatable subcommands. ![subcommands-repeatable](https://picocli.info/images/subcommands-repeatable.png) @@ -95,6 +95,11 @@ Note that it is not valid to specify a subcommand followed by its parent command myapp add -x=item1 -w=0.2 myapp ``` +### Subcommands are now lazily instantiated + +From this release, subcommands are not instantiated until they are matched on the command line, +unless the user object has a `@Spec` or `@ParentObject`-annotated field; these are instantiated during initialization. + ### Injecting `CommandSpec` Into a `IVersionProvider` @@ -115,11 +120,6 @@ class MyVersionProvider implements IVersionProvider { } ``` -### Lazily instantiate subcommands - -From this release, subcommands are not instantiated until they are matched on the command line, -unless the user object has a `@Spec` or `@ParentObject`-annotated field; these are instantiated during initialization. - ### Mixins with `@ParentCommand`-annotated fields TODO diff --git a/docs/images/subcommands-repeatable.png b/docs/images/subcommands-repeatable.png index 30663c3e..539249f8 100644 Binary files a/docs/images/subcommands-repeatable.png and b/docs/images/subcommands-repeatable.png differ diff --git a/docs/index.adoc b/docs/index.adoc index 61cb1874..de7574ff 100644 --- a/docs/index.adoc +++ b/docs/index.adoc @@ -4086,7 +4086,7 @@ This invocation is valid because `myapp` is marked with `subcommandsRepeatable = ==== Repeatable Subcommands Specification Normally, `subcommandsRepeatable` is `false`, so for each command, only one of its subcommands can be specified, potentially followed by only one sub-subcommand of that subcommand, etc. -In mathematical terms, a valid sequence of commands and subcommands can be represented by a _directed rooted tree_ that starts at the top-level command, illustrated by the diagram below. +In mathematical terms, a valid sequence of commands and subcommands can be represented by a _directed rooted tree_ that starts at the top-level command. This is illustrated by the diagram below. [#sequences-when-subcommands-not-repeatable] .By default, valid sequences of commands and subcommands form a directed rooted tree. @@ -4097,7 +4097,7 @@ Also, a subcommand can be followed by a "sibling" command (another command with In mathematical terms, when a parent command has this property, the additional valid sequences of its subcommands form a fully connected subgraph (_a complete digraph_). -The blue dotted arrows in the diagram below illustrate the additional sequences that are allowed when a command has repeatable subcommands. +The blue and green dotted arrows in the diagram below illustrate the additional sequences that are allowed when a command has repeatable subcommands. [#sequences-when-subcommands-repeatable] .If a command is marked to allow repeatable subcommands, the additional valid sequences of its subcommands form a fully connected subgraph.