Top Deprecated
picocli 4.7.5

Deprecated API


No API in this release is deprecated for removal.

Deprecated Item Summary

SinceDeprecated Item and Description
picocli.CommandLine.AbstractHandler<
the return type of this handler
R
,
The type of the handler subclass; for fluent API method chaining
T extends CommandLine.AbstractHandler<R, T>
>

see execute(String...)

picocli.CommandLine.AbstractHandler.andExit(int exitCode)

use CommandLine#execute(String...) instead, and call System.exit() in the application.

picocli.CommandLine.DefaultExceptionHandler.self()

Deprecated as a consequence of CommandLine.DefaultExceptionHandler being deprecated. See corresponding docs for further information.

Returns:

the Text object at the specified row and column
picocli.CommandLine.Help.TextTable.cellAt
(int
the row of the cell whose Text to return
row
,
int
the column of the cell whose Text to return
col
)

use textAt(int, int) instead

picocli.CommandLine.Help.TextTable.forColumnWidths(CommandLine.Help.Ansi
whether to emit ANSI escape codes or not
ansi
,
int...
the width of each table column (all columns have zero indent)
columnWidths
)

use forColumns(CommandLine.Help.ColorScheme, CommandLine.Help.Column...) instead

picocli.CommandLine.Help.TextTable.forColumns(CommandLine.Help.Ansi
whether to emit ANSI escape codes or not
ansi
,
CommandLine.Help.Column...
columns to construct this TextTable with
columns
)

use forColumns(CommandLine.Help.ColorScheme, CommandLine.Help.Column...) instead

picocli.CommandLine.Help.TextTable.forDefaultColumns(CommandLine.Help.Ansi
whether to emit ANSI escape codes or not
ansi
,
int
the total width of the columns combined
usageHelpWidth
)

use forDefaultColumns(CommandLine.Help.Ansi, int, int) instead

picocli.CommandLine.Help.TextTable.forDefaultColumns(CommandLine.Help.Ansi
whether to emit ANSI escape codes or not
ansi
,
int
the width of the long options column
longOptionsColumnWidth
,
int
the total width of the columns combined
usageHelpWidth
)

use forDefaultColumns(CommandLine.Help.ColorScheme, int, int) instead

Returns:

this Help instance (for method chaining)
picocli.CommandLine.Help.addSubcommand
(String
the name of the subcommand to display in the usage message
commandName
,
Object
the CommandSpec or @Command annotated object to get more information from
command
)

use addAllSubcommands(Map) instead

Returns:

a detailed synopsis
picocli.CommandLine.Help.detailedSynopsis
(Comparator<CommandLine.Model.OptionSpec>
comparator to sort options or null if options should not be sorted
optionSort
,
boolean
true if boolean short options should be clustered into a single string
clusterBooleanOptions
)

use detailedSynopsis(int, Comparator, boolean) instead.

Returns:

a synopsis
picocli.CommandLine.Help.synopsis
()

use synopsis(int) instead

picocli.CommandLine.HelpCommand

Deprecated as a consequence of CommandLine.IHelpCommandInitializable being deprecated. See corresponding docs for further information.

picocli.CommandLine.HelpCommand.init(CommandLine
the CommandLine object associated with this help command. Implementors can use this to walk the command hierarchy and get access to the help command's parent and sibling commands.
helpCommandLine
,
CommandLine.Help.Ansi
whether to use Ansi colors or not
ansi
,
PrintStream
the stream to print the usage help message to
out
,
PrintStream
the error stream to print any diagnostic messages to, in addition to the output from the exception handler
err
)

picocli.CommandLine.IHelpCommandInitializable.init(CommandLine
the CommandLine object associated with this help command. Implementors can use this to walk the command hierarchy and get access to the help command's parent and sibling commands.
helpCommandLine
,
CommandLine.Help.Ansi
whether to use Ansi colors or not
ansi
,
PrintStream
the stream to print the usage help message to
out
,
PrintStream
the error stream to print any diagnostic messages to, in addition to the output from the exception handler
err
)

picocli.CommandLine.IParseResultHandler2<
the return type of this handler
R
>

use IExecutionStrategy instead, see execute(String...)

picocli.CommandLine.Model.ArgSpec.setValue(T newValue, CommandLine commandLine)

use setValue(Object) instead. This was a design mistake.

Returns:

a new Range indicating the default arity of the specified type
picocli.CommandLine.Range.defaultArity
(Class<?>
the type whose default arity to return
type
)

use defaultArity(Field) instead

picocli.CommandLine.RunAll

Deprecated as a consequence of CommandLine.AbstractParseResultHandler and CommandLine.IParseResultHandler being deprecated. See corresponding docs for further information.

picocli.CommandLine.RunAll.self()

Deprecated as a consequence of CommandLine.RunAll being deprecated. See corresponding docs for further information.

picocli.CommandLine.RunFirst

Deprecated as a consequence of CommandLine.AbstractParseResultHandler and CommandLine.IParseResultHandler being deprecated. See corresponding docs for further information.

picocli.CommandLine.RunFirst.self()

Deprecated as a consequence of CommandLine.RunFirst being deprecated. See corresponding docs for further information.

picocli.CommandLine.RunLast

Deprecated as a consequence of CommandLine.AbstractParseResultHandler and CommandLine.IParseResultHandler being deprecated. See corresponding docs for further information.

picocli.CommandLine.RunLast.self()

Deprecated as a consequence of CommandLine.RunLast being deprecated. See corresponding docs for further information.

Returns:

null if an error occurred while parsing the command line options, or if help was requested and printed. Otherwise returns the result of calling the Callable
picocli.CommandLine.call
(C
the command to call when parsing succeeds.
callable
,
String...
the command line arguments to parse
args
)

use execute(String...) and getExecutionResult() instead

Returns:

null if an error occurred while parsing the command line options, or if help was requested and printed. Otherwise returns the result of calling the Callable
picocli.CommandLine.call
(C
the command to call when parsing succeeds.
callable
,
PrintStream
the printStream to print the usage help message to when the user requested help
out
,
String...
the command line arguments to parse
args
)

use execute(String...) and getExecutionResult() instead

Returns:

null if an error occurred while parsing the command line options, or if help was requested and printed. Otherwise returns the result of calling the Callable
picocli.CommandLine.call
(C
the command to call when parsing succeeds.
callable
,
PrintStream
the printStream to print the usage help message to when the user requested help
out
,
CommandLine.Help.Ansi
the ANSI style to use
ansi
,
String...
the command line arguments to parse
args
)

use execute(String...) and getExecutionResult() instead

Returns:

null if an error occurred while parsing the command line options, or if help was requested and printed. Otherwise returns the result of calling the Callable
picocli.CommandLine.call
(C
the command to call when parsing succeeds.
callable
,
PrintStream
the printStream to print the usage help message to when the user requested help
out
,
PrintStream
the printStream to print diagnostic messages to
err
,
CommandLine.Help.Ansi
including whether the usage message should include ANSI escape codes or not
ansi
,
String...
the command line arguments to parse
args
)

use execute(String...) and getExecutionResult() instead

Returns:

null if an error occurred while parsing the command line options, or if help was requested and printed. Otherwise returns the result of calling the Callable
picocli.CommandLine.call
(Class<C>
class of the command to call when parsing succeeds.
callableClass
,
CommandLine.IFactory
the factory responsible for instantiating the specified callable class and potentially inject other components
factory
,
String...
the command line arguments to parse
args
)

use execute(String...) and getExecutionResult() instead

Returns:

null if an error occurred while parsing the command line options, or if help was requested and printed. Otherwise returns the result of calling the Callable
picocli.CommandLine.call
(Class<C>
class of the command to call when parsing succeeds.
callableClass
,
CommandLine.IFactory
the factory responsible for instantiating the specified callable class and potentially injecting other components
factory
,
PrintStream
the printStream to print the usage help message to when the user requested help
out
,
String...
the command line arguments to parse
args
)

use execute(String...) and getExecutionResult() instead

Returns:

null if an error occurred while parsing the command line options, or if help was requested and printed. Otherwise returns the result of calling the Callable
picocli.CommandLine.call
(Class<C>
class of the command to call when parsing succeeds.
callableClass
,
CommandLine.IFactory
the factory responsible for instantiating the specified callable class and potentially injecting other components
factory
,
PrintStream
the printStream to print the usage help message to when the user requested help
out
,
CommandLine.Help.Ansi
the ANSI style to use
ansi
,
String...
the command line arguments to parse
args
)

use execute(String...) and getExecutionResult() instead

Returns:

null if an error occurred while parsing the command line options, or if help was requested and printed. Otherwise returns the result of calling the Callable
picocli.CommandLine.call
(Class<C>
class of the command to call when parsing succeeds.
callableClass
,
CommandLine.IFactory
the factory responsible for instantiating the specified callable class and potentially injecting other components
factory
,
PrintStream
the printStream to print the usage help message to when the user requested help
out
,
PrintStream
the printStream to print diagnostic messages to
err
,
CommandLine.Help.Ansi
the ANSI style to use
ansi
,
String...
the command line arguments to parse
args
)

use execute(String...) and getExecutionResult() instead

picocli.CommandLine.defaultExceptionHandler()

Deprecated as a consequence of CommandLine.DefaultExceptionHandler being deprecated. See corresponding docs for further information.

picocli.CommandLine.invoke(String
the @Command-annotated method to build a CommandSpec model from, and run when parsing succeeds.
methodName
,
Class<?>
the class where the @Command-annotated method is declared, or a subclass
cls
,
String...
the command line arguments to parse
args
)

use execute(String...) and getExecutionResult() instead

picocli.CommandLine.invoke(String
the @Command-annotated method to build a CommandSpec model from, and run when parsing succeeds.
methodName
,
Class<?>
the class where the @Command-annotated method is declared, or a subclass
cls
,
PrintStream
the printstream to print requested help message to
out
,
String...
the command line arguments to parse
args
)

use execute(String...) and getExecutionResult() instead

picocli.CommandLine.invoke(String
the @Command-annotated method to build a CommandSpec model from, and run when parsing succeeds.
methodName
,
Class<?>
the class where the @Command-annotated method is declared, or a subclass
cls
,
PrintStream
the printstream to print requested help message to
out
,
CommandLine.Help.Ansi
whether the usage message should include ANSI escape codes or not
ansi
,
String...
the command line arguments to parse
args
)

use execute(String...) and getExecutionResult() instead

picocli.CommandLine.invoke(String
the @Command-annotated method to build a CommandSpec model from, and run when parsing succeeds.
methodName
,
Class<?>
the class where the @Command-annotated method is declared, or a subclass
cls
,
PrintStream
the printStream to print the usage help message to when the user requested help
out
,
PrintStream
the printStream to print diagnostic messages to
err
,
CommandLine.Help.Ansi
whether the usage message should include ANSI escape codes or not
ansi
,
String...
the command line arguments to parse
args
)

use execute(String...) and getExecutionResult() instead

Returns:

true if the parser is allowed to split quoted Strings, false otherwise;
picocli.CommandLine.isSplitQuotedStrings
()

Most applications should not change the default. The rare application that does need to split parameter values without respecting quotes should use ParserSpec#splitQuotedStrings(boolean).

Returns:

a list with the top-level command and any subcommands initialized by this method
picocli.CommandLine.parse
(String...
the command line arguments to parse
args
)

use parseArgs(String...) instead

Returns:

an object resulting from handling the parse result or the exception that occurred while parsing the input
picocli.CommandLine.parseWithHandler
(CommandLine.IParseResultHandler2<R>
the function that will handle the result of successfully parsing the command line arguments
handler
,
String[]
the command line arguments
args
)

use execute(String...) and getExecutionResult() instead

Returns:

an object resulting from handling the parse result or the exception that occurred while parsing the input
picocli.CommandLine.parseWithHandlers
(CommandLine.IParseResultHandler2<R>
the function that will handle the result of successfully parsing the command line arguments
handler
,
CommandLine.IExceptionHandler2<R>
the function that can handle the ParameterException thrown when the command line arguments are invalid
exceptionHandler
,
String...
the command line arguments
args
)

use execute(String...) and getExecutionResult() instead

Returns:

true if help was printed, false otherwise
picocli.CommandLine.printHelpIfRequested
(List<CommandLine>
the list of CommandLine objects to check if help was requested
parsedCommands
,
PrintStream
the PrintStream to print help to if requested
out
,
PrintStream
the error string to print diagnostic messages to, in addition to the output from the exception handler
err
,
CommandLine.Help.Ansi
for printing help messages using ANSI styles and colors
ansi
)

use executeHelpRequest(ParseResult) instead

Returns:

true if help was printed, false otherwise
picocli.CommandLine.printHelpIfRequested
(List<CommandLine>
the list of CommandLine objects to check if help was requested
parsedCommands
,
PrintStream
the PrintStream to print help to if requested
out
,
PrintStream
the error string to print diagnostic messages to, in addition to the output from the exception handler
err
,
CommandLine.Help.ColorScheme
for printing help messages using ANSI styles and colors
colorScheme
)

use executeHelpRequest(ParseResult) instead

picocli.CommandLine.run(R
the command to run when parsing succeeds.
runnable
,
String...
the command line arguments to parse
args
)

use execute(String...) instead

picocli.CommandLine.run(R
the command to run when parsing succeeds.
runnable
,
PrintStream
the printStream to print the usage help message to when the user requested help
out
,
String...
the command line arguments to parse
args
)

use execute(String...) instead

picocli.CommandLine.run(R
the command to run when parsing succeeds.
runnable
,
PrintStream
the printStream to print the usage help message to when the user requested help
out
,
CommandLine.Help.Ansi
whether the usage message should include ANSI escape codes or not
ansi
,
String...
the command line arguments to parse
args
)

use execute(String...) instead

picocli.CommandLine.run(R
the command to run when parsing succeeds.
runnable
,
PrintStream
the printStream to print the usage help message to when the user requested help
out
,
PrintStream
the printStream to print diagnostic messages to
err
,
CommandLine.Help.Ansi
whether the usage message should include ANSI escape codes or not
ansi
,
String...
the command line arguments to parse
args
)

use execute(String...) instead

picocli.CommandLine.run(Class<R>
class of the command to run when parsing succeeds.
runnableClass
,
CommandLine.IFactory
the factory responsible for instantiating the specified Runnable class and potentially injecting other components
factory
,
String...
the command line arguments to parse
args
)

use execute(String...) instead

picocli.CommandLine.run(Class<R>
class of the command to run when parsing succeeds.
runnableClass
,
CommandLine.IFactory
the factory responsible for instantiating the specified Runnable class and potentially injecting other components
factory
,
PrintStream
the printStream to print the usage help message to when the user requested help
out
,
String...
the command line arguments to parse
args
)

use execute(String...) instead

picocli.CommandLine.run(Class<R>
class of the command to run when parsing succeeds.
runnableClass
,
CommandLine.IFactory
the factory responsible for instantiating the specified Runnable class and potentially injecting other components
factory
,
PrintStream
the printStream to print the usage help message to when the user requested help
out
,
CommandLine.Help.Ansi
whether the usage message should include ANSI escape codes or not
ansi
,
String...
the command line arguments to parse
args
)

use execute(String...) instead

picocli.CommandLine.run(Class<R>
class of the command to run when parsing succeeds.
runnableClass
,
CommandLine.IFactory
the factory responsible for instantiating the specified Runnable class and potentially injecting other components
factory
,
PrintStream
the printStream to print the usage help message to when the user requested help
out
,
PrintStream
the printStream to print diagnostic messages to
err
,
CommandLine.Help.Ansi
whether the usage message should include ANSI escape codes or not
ansi
,
String...
the command line arguments to parse
args
)

use execute(String...) instead

Returns:

this CommandLine object, to allow method chaining
picocli.CommandLine.setSplitQuotedStrings
(boolean
the new setting
newValue
)

Most applications should not change the default. The rare application that does need to split parameter values without respecting quotes should use ParserSpec#splitQuotedStrings(boolean).