Skip to content

Commit

Permalink
#121 add more links to picocli user manual and javadoc from autocompl…
Browse files Browse the repository at this point in the history
…ete manual
  • Loading branch information
remkop committed Aug 8, 2017
1 parent 7a66460 commit d683e1c
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 9 deletions.
10 changes: 6 additions & 4 deletions docs/1.0.0-SNAPSHOT/autocomplete.html
Original file line number Diff line number Diff line change
Expand Up @@ -591,7 +591,8 @@ <h2 id="_introduction">1. Introduction</h2>
<h2 id="_command_line_completion_example">2. Command Line Completion Example</h2>
<div class="sectionbody">
<div class="paragraph">
<p>Assume we have a picocli-based command line application with subcommands, all of which have some options. Below is an example:</p>
<p>Assume we have a <a href="index.html">picocli</a>-based command line application with <a href="index.html#_subcommands">subcommands</a>,
all of which have some <a href="index.html#_options_and_parameters">options</a>. Below is an example:</p>
</div>
<div class="listingblock">
<div class="content">
Expand Down Expand Up @@ -752,14 +753,15 @@ <h3 id="_overview">3.1. Overview</h3>
</div>
</div>
<div class="paragraph">
<p>This will instantiate your command, and inspect it for <code>@Option</code> and <code>@Command</code> annotations.
<p>This will instantiate your command, and inspect it for <a href="http://picocli.info/apidocs/picocli/CommandLine.Option.html"><code>@Option</code></a>
and <a href="http://picocli.info/apidocs/picocli/CommandLine.Command.html"><code>@Command</code></a> annotations.
Based on these annotations it will generate a completion script in the current directory.</p>
</div>
</div>
<div class="sect2">
<h3 id="_command_name">3.2. Command Name</h3>
<div class="paragraph">
<p>The name of the generated completion script is based on the <code>@Command(name ="&lt;COMMAND-NAME&gt;")</code> annotation, or, if that is missing, the command class name.
<p>The name of the generated completion script is based on the <code>@Command(name ="&lt;COMMAND-NAME&gt;")</code> <a href="index.html#_command_name">annotation</a>, or, if that is missing, the command class name.
Use the <code>-n</code> or <code>--name</code> option to control the name of the command that the completion script is for.</p>
</div>
<div class="listingblock">
Expand Down Expand Up @@ -952,7 +954,7 @@ <h2 id="_releases">10. Releases</h2>
<div id="footer">
<div id="footer-text">
Version 1.0.0-BETA1<br>
Last updated 2017-08-08 22:05:59 +09:00
Last updated 2017-08-09 00:16:09 +09:00
</div>
</div>
</body>
Expand Down
10 changes: 8 additions & 2 deletions docs/1.0.0-SNAPSHOT/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -1058,7 +1058,7 @@ <h3 id="_default_arity">4.1. Default Arity</h3>
<div class="ulist">
<ul>
<li>
<p>Boolean fields: the default arity is 0 (consume zero parameters) the field is set to <code>true</code> when the option name is recognized. (You can <a href="#_boolean_parameters">change this</a>.)</p>
<p>Boolean fields: the default arity is 0 (consume zero parameters) the field is toggled to its logical negative when the option name is recognized. (You can <a href="#_boolean_parameters">change this</a>.)</p>
</li>
<li>
<p>Single-valued types like <code>int</code>, <code>String</code>, <code>File</code>: arity is 1 (consume one parameter). Omitting the option parameter results in a ParameterException: "Missing required parameter for field '&lt;field-name&gt;'".</p>
Expand Down Expand Up @@ -2841,13 +2841,15 @@ <h2 id="_download">19. Download</h2>
* converters are registered only with the subcommand hierarchy as it existed when the custom type was registered.
* To ensure a custom type converter is available to all subcommands, register the type converter last, after
* adding subcommands.&lt;/p&gt;
* &lt;p&gt;See also the {@link Command#subcommands()} annotation to register subcommands declaratively.&lt;/p&gt;
*
* @param name the string to recognize on the command line as a subcommand
* @param command the object to initialize with command line arguments following the subcommand name.
* This may be a {@code CommandLine} instance with its own (nested) subcommands
* @return this CommandLine object, to allow method chaining
* @see #registerConverter(Class, ITypeConverter)
* @since 0.9.7
* @see Command#subcommands()
*/</span>
<span class="directive">public</span> CommandLine addSubcommand(<span class="predefined-type">String</span> name, <span class="predefined-type">Object</span> command) {
CommandLine commandLine = toCommandLine(command);
Expand Down Expand Up @@ -3103,6 +3105,7 @@ <h2 id="_download">19. Download</h2>
* Delegates to {@link #printVersionHelp(PrintStream, Help.Ansi)} with the {@linkplain Help.Ansi#AUTO platform default}.
* @param out the printStream to print to
* @see #printVersionHelp(PrintStream, Help.Ansi)
* @since 0.9.8
*/</span>
<span class="directive">public</span> <span class="type">void</span> printVersionHelp(<span class="predefined-type">PrintStream</span> out) { printVersionHelp(out, Help.Ansi.AUTO); }

Expand All @@ -3115,6 +3118,7 @@ <h2 id="_download">19. Download</h2>
* @see Command#version()
* @see Option#versionHelp()
* @see #isVersionHelpRequested()
* @since 0.9.8
*/</span>
<span class="directive">public</span> <span class="type">void</span> printVersionHelp(<span class="predefined-type">PrintStream</span> out, Help.Ansi ansi) {
<span class="keyword">for</span> (<span class="predefined-type">String</span> versionInfo : versionLines) {
Expand Down Expand Up @@ -3353,6 +3357,7 @@ <h2 id="_download">19. Download</h2>
* and take the appropriate action.
* &lt;/p&gt;
* @return whether this option allows the user to request usage help
* @since 0.9.8
*/</span>
<span class="type">boolean</span> usageHelp() <span class="keyword">default</span> <span class="predefined-constant">false</span>;

Expand All @@ -3370,6 +3375,7 @@ <h2 id="_download">19. Download</h2>
* and take the appropriate action.
* &lt;/p&gt;
* @return whether this option allows the user to request version information
* @since 0.9.8
*/</span>
<span class="type">boolean</span> versionHelp() <span class="keyword">default</span> <span class="predefined-constant">false</span>;

Expand Down Expand Up @@ -6556,7 +6562,7 @@ <h2 id="_download">19. Download</h2>
<div id="footer">
<div id="footer-text">
Version 1.0.0-SNAPSHOT<br>
Last updated 2017-08-08 22:53:29 +09:00
Last updated 2017-08-09 00:09:57 +09:00
</div>
</div>
</body>
Expand Down
8 changes: 5 additions & 3 deletions docs/autocomplete.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ with those few characters. The user can type more characters and press TAB again
list if the typed characters are still ambiguous, or else complete the subcommand or option.

== Command Line Completion Example
Assume we have a picocli-based command line application with subcommands, all of which have some options. Below is an example:
Assume we have a link:index.html[picocli]-based command line application with link:index.html#_subcommands[subcommands],
all of which have some link:index.html#_options_and_parameters[options]. Below is an example:

[source,java]
----
Expand Down Expand Up @@ -143,11 +144,12 @@ the fully qualified class name of the annotated command object.
$ java -jar picocli-1.0.0.jar com.myproject.MyCommand
----

This will instantiate your command, and inspect it for `@Option` and `@Command` annotations.
This will instantiate your command, and inspect it for http://picocli.info/apidocs/picocli/CommandLine.Option.html[`@Option`]
and http://picocli.info/apidocs/picocli/CommandLine.Command.html[`@Command`] annotations.
Based on these annotations it will generate a completion script in the current directory.

=== Command Name
The name of the generated completion script is based on the `@Command(name ="<COMMAND-NAME>")` annotation, or, if that is missing, the command class name.
The name of the generated completion script is based on the `@Command(name ="<COMMAND-NAME>")` link:index.html#_command_name[annotation], or, if that is missing, the command class name.
Use the `-n` or `--name` option to control the name of the command that the completion script is for.

[source,bash]
Expand Down

0 comments on commit d683e1c

Please sign in to comment.