Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Quick guide: replace deprecated method calls #883

Merged
merged 1 commit into from
Nov 26, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions docs/quick-guide.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ Picocli matches the option names to set the field values.
----
String[] args = { "-c", "--file", "result.tar", "file1.txt", "file2.txt" };
Tar tar = new Tar();
new CommandLine(tar).parse(args);
new CommandLine(tar).parseArgs(args);

assert !tar.helpRequested;
assert tar.create;
Expand Down Expand Up @@ -324,7 +324,7 @@ usage help or version information was requested (without inspecting the annotate
[source,java]
----
CommandLine commandLine = new CommandLine(new App());
commandLine.parse(args);
commandLine.parseArgs(args);
if (commandLine.isUsageHelpRequested()) {
commandLine.usage(System.out);
return;
Expand All @@ -334,7 +334,7 @@ if (commandLine.isUsageHelpRequested()) {
}
// ... run App's business logic
----
See also <<Parsing>> and <<Runnable and Callable>> for how picocli can help reduce boilerplate code.
See also the chapter link:http://picocli.info/#_printing_help_automatically[Printing Help Automatically] of the user manual.

== Version Help
=== Static Version Information
Expand Down Expand Up @@ -400,13 +400,13 @@ Concatenate FILE(s), or standard input, to standard output.
-v, --show-nonprinting use ^ and M- notation, except for LDF and TAB
--help display this help and exit
--version output version information and exit
Copyright(c) 2017
Copyright(c) 2019
----

The usage help message is generated from annotation attributes, like below:
[source,java]
----
@Command(name = "cat", footer = "Copyright(c) 2017",
@Command(name = "cat", footer = "Copyright(c) 2019",
description = "Concatenate FILE(s), or standard input, to standard output.")
class Cat {

Expand Down