本文整理了Java中org.sonatype.gshell.util.cli2.Option.<init>()
方法的一些代码示例,展示了Option.<init>()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Option.<init>()
方法的具体详情如下:
包路径:org.sonatype.gshell.util.cli2.Option
类名称:Option
方法名:<init>
暂无
代码示例来源:origin: org.sonatype.gshell/gshell-core
@Option(name = "h", longName = "help", override=true)
public boolean displayHelp;
代码示例来源:origin: org.sonatype.gshell/gshell-core
@Option(name = "P", longName = "property")
protected void setSystemProperty(final String input) {
NameValue nv = NameValue.parse(input);
System.setProperty(nv.name, nv.value);
}
代码示例来源:origin: org.sonatype.maven.archetype/archetype-commands
@Option(name = "D", longName="define", args=1)
protected void setProperty(final String input) {
NameValue nv = NameValue.parse(input);
props.setProperty(nv.name, nv.value);
}
代码示例来源:origin: org.sonatype.maven.archetype/archetype-commands
@Option(name = "D", longName="define", args=1)
protected void setProperty(final String input) {
NameValue nv = NameValue.parse(input);
props.setProperty(nv.name, nv.value);
}
代码示例来源:origin: org.sonatype.gshell.commands/gshell-logging
@Option(name="n", longName="name")
private String nameQuery;
@Option(name="t", longName="type")
private String typeQuery;
@Option(name="v", longName="verbose")
private boolean verbose;
代码示例来源:origin: org.sonatype.gshell.commands/gshell-logging
@Option(name="n", longName="name")
private String nameQuery;
@Option(name="l", longName="level")
private String levelQuery;
@Option(name="a", longName="all")
private boolean all;
代码示例来源:origin: org.sonatype.gshell.commands/gshell-vfs
@Option(name="iname")
private void addiNameFilter(final String name) throws MalformedPatternException {
log.debug("Adding -iname selector for: {}", name);
selector.getSelectors().add(new NameSelector(name, true));
}
代码示例来源:origin: org.sonatype.gshell.commands/gshell-vfs
@Option(name="name")
private void addNameFilter(final String name) throws MalformedPatternException {
log.debug("Adding -name selector for: {}", name);
selector.getSelectors().add(new NameSelector(name));
}
代码示例来源:origin: org.sonatype.gshell.commands/gshell-vfs
@Option(name="type")
private void addTypeFilter(final Type type) {
log.debug("Adding -type selector for: {}", type);
selector.getSelectors().add(new TypeSelector(type));
}
代码示例来源:origin: org.sonatype.gshell.commands/gshell-network
/**
* Displays the name of the current host.
*
* @author <a href="mailto:jason@planet57.com">Jason Dillon</a>
* @since 2.0
*/
@Command(name="hostname")
public class HostnameCommand
extends CommandActionSupport
{
@Option(name="v", longName="verbose")
private boolean verbose;
public Object execute(final CommandContext context) throws Exception {
assert context != null;
IO io = context.getIo();
InetAddress localhost = InetAddress.getLocalHost();
io.println(localhost.getHostName());
if (verbose) {
io.println(localhost.getHostAddress());
}
return Result.SUCCESS;
}
}
代码示例来源:origin: org.sonatype.gshell/gshell-core
@Preference(name = "color")
@Option(name = "C", longName = "color")
protected void enableAnsiColors(final Boolean flag) {
Ansi.setEnabled(flag);
}
代码示例来源:origin: org.sonatype.gshell/gshell-core
@Preference(name = "terminal")
@Option(name = "T", longName = "terminal")
protected void setTerminalType(final String type) {
TerminalFactory.configure(type);
}
代码示例来源:origin: org.sonatype.gshell/gshell-core
@Option(name = "D", longName = "define")
protected void setVariable(final String input) {
NameValue nv = NameValue.parse(input);
vars.set(nv.name, nv.value);
}
代码示例来源:origin: org.sonatype.gshell/gshell-core
@Preference(name = "quiet")
@Option(name = "q", longName = "quiet")
protected void setQuiet(final boolean flag) {
if (flag) {
setConsoleLogLevel(Level.ERROR);
io.setVerbosity(IO.Verbosity.QUIET);
}
}
代码示例来源:origin: org.sonatype.gshell/gshell-core
@Preference(name = "debug")
@Option(name = "d", longName = "debug")
protected void setDebug(final boolean flag) {
if (flag) {
setConsoleLogLevel(Level.DEBUG);
io.setVerbosity(IO.Verbosity.NORMAL);
showErrorTraces = true;
}
}
代码示例来源:origin: org.sonatype.gshell/gshell-core
@Preference(name = "trace")
@Option(name = "X", longName = "trace")
protected void setTrace(final boolean flag) {
if (flag) {
setConsoleLogLevel(Level.TRACE);
io.setVerbosity(IO.Verbosity.NORMAL);
showErrorTraces = true;
}
}
代码示例来源:origin: org.sonatype.gshell.commands/gshell-shell
@Option(name="m", longName="mask")
private Character mask;
代码示例来源:origin: org.sonatype.gshell.commands/gshell-standard
extends CommandActionSupport
@Option(name = "n", optionalArg = true)
private boolean noTrailingNewline;
代码示例来源:origin: org.sonatype.maven.archetype/archetype-commands
@Option(name="c", longName="catalog", args=1)
private File catalogFile;
代码示例来源:origin: org.sonatype.gshell.commands/gshell-shell
@Option(name="m", longName="method")
private String methodName = "main";
内容来源于网络,如有侵权,请联系作者删除!