public static class Context.Builder
| Constructor and Description |
|---|
Builder(CliktCommand command,
Context parent) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
getAllowInterspersedArgs()
If false, options and arguments cannot be mixed; the first time an argument is encountered, all
remaining tokens are parsed as arguments.
|
java.lang.String |
getAutoEnvvarPrefix()
The prefix to add to inferred envvar names.
|
CliktConsole |
getConsole()
The console that will handle reading and writing text.
|
HelpFormatter |
getHelpFormatter()
The help formatter for this command
|
java.lang.String |
getHelpOptionMessage()
The description of the help option.
|
java.util.Set<java.lang.String> |
getHelpOptionNames()
The names to use for the help option.
|
boolean |
getPrintExtraMessages()
Set this to false to prevent extra messages from being printed automatically.
|
kotlin.jvm.functions.Function2<com.github.ajalt.clikt.core.Context,java.lang.String,java.lang.String> |
getTokenTransformer()
An optional transformation function that is called to transform command line
|
void |
setAllowInterspersedArgs(boolean p)
If false, options and arguments cannot be mixed; the first time an argument is encountered, all
remaining tokens are parsed as arguments.
|
void |
setAutoEnvvarPrefix(java.lang.String p)
The prefix to add to inferred envvar names.
|
void |
setConsole(CliktConsole p)
The console that will handle reading and writing text.
|
void |
setHelpFormatter(HelpFormatter p)
The help formatter for this command
|
void |
setHelpOptionMessage(java.lang.String p)
The description of the help option.
|
void |
setHelpOptionNames(java.util.Set<java.lang.String> p)
The names to use for the help option.
|
void |
setPrintExtraMessages(boolean p)
Set this to false to prevent extra messages from being printed automatically.
|
void |
setTokenTransformer(kotlin.jvm.functions.Function2<? super com.github.ajalt.clikt.core.Context,? super java.lang.String,java.lang.String> p)
An optional transformation function that is called to transform command line
|
public Builder(@NotNull
CliktCommand command,
@Nullable
Context parent)
public boolean getAllowInterspersedArgs()
If false, options and arguments cannot be mixed; the first time an argument is encountered, all remaining tokens are parsed as arguments.
public void setAllowInterspersedArgs(boolean p)
If false, options and arguments cannot be mixed; the first time an argument is encountered, all remaining tokens are parsed as arguments.
public boolean getPrintExtraMessages()
Set this to false to prevent extra messages from being printed automatically.
You can still access them at CliktCommand.messages inside of CliktCommand.run.
CliktCommand.messages,
CliktCommand.runpublic void setPrintExtraMessages(boolean p)
Set this to false to prevent extra messages from being printed automatically.
You can still access them at CliktCommand.messages inside of CliktCommand.run.
CliktCommand.messages,
CliktCommand.run@NotNull public java.util.Set<java.lang.String> getHelpOptionNames()
The names to use for the help option.
If any names in the set conflict with other options, the conflicting name will not be used for the help option. If the set is empty, or contains no unique names, no help option will be added.
public void setHelpOptionNames(@NotNull
java.util.Set<java.lang.String> p)
The names to use for the help option.
If any names in the set conflict with other options, the conflicting name will not be used for the help option. If the set is empty, or contains no unique names, no help option will be added.
@NotNull public java.lang.String getHelpOptionMessage()
The description of the help option.
public void setHelpOptionMessage(@NotNull
java.lang.String p)
The description of the help option.
@NotNull public HelpFormatter getHelpFormatter()
The help formatter for this command
public void setHelpFormatter(@NotNull
HelpFormatter p)
The help formatter for this command
@NotNull public kotlin.jvm.functions.Function2<com.github.ajalt.clikt.core.Context,java.lang.String,java.lang.String> getTokenTransformer()
An optional transformation function that is called to transform command line
public void setTokenTransformer(@NotNull
kotlin.jvm.functions.Function2<? super com.github.ajalt.clikt.core.Context,? super java.lang.String,java.lang.String> p)
An optional transformation function that is called to transform command line
@Nullable public java.lang.String getAutoEnvvarPrefix()
The prefix to add to inferred envvar names.
If null, the prefix is based on the parent's prefix, if there is one. If no command specifies, a prefix, envvar lookup is disabled.
public void setAutoEnvvarPrefix(@Nullable
java.lang.String p)
The prefix to add to inferred envvar names.
If null, the prefix is based on the parent's prefix, if there is one. If no command specifies, a prefix, envvar lookup is disabled.
@NotNull public CliktConsole getConsole()
The console that will handle reading and writing text.
The default uses System.in and System.out.
public void setConsole(@NotNull
CliktConsole p)
The console that will handle reading and writing text.
The default uses System.in and System.out.