当前位置: 首页>>代码示例>>Java>>正文


Java OptionHelp类代码示例

本文整理汇总了Java中org.springframework.boot.cli.command.options.OptionHelp的典型用法代码示例。如果您正苦于以下问题:Java OptionHelp类的具体用法?Java OptionHelp怎么用?Java OptionHelp使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


OptionHelp类属于org.springframework.boot.cli.command.options包,在下文中一共展示了OptionHelp类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: CommandCompleter

import org.springframework.boot.cli.command.options.OptionHelp; //导入依赖的package包/类
public CommandCompleter(ConsoleReader consoleReader,
		ArgumentDelimiter argumentDelimiter, Iterable<Command> commands) {
	this.console = consoleReader;
	List<String> names = new ArrayList<String>();
	for (Command command : commands) {
		this.commands.add(command);
		names.add(command.getName());
		List<String> options = new ArrayList<String>();
		for (OptionHelp optionHelp : command.getOptionsHelp()) {
			options.addAll(optionHelp.getOptions());
		}
		AggregateCompleter argumentCompleters = new AggregateCompleter(
				new StringsCompleter(options), new FileNameCompleter());
		ArgumentCompleter argumentCompleter = new ArgumentCompleter(argumentDelimiter,
				argumentCompleters);
		argumentCompleter.setStrict(false);
		this.commandCompleters.put(command.getName(), argumentCompleter);
	}
	getStrings().addAll(names);
}
 
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:21,代码来源:CommandCompleter.java

示例2: getOptionsHelp

import org.springframework.boot.cli.command.options.OptionHelp; //导入依赖的package包/类
@Override
public Collection<OptionHelp> getOptionsHelp() {
	List<OptionHelp> help = new ArrayList<OptionHelp>();
	for (final Command command : this.commandRunner) {
		if (isHelpShown(command)) {
			help.add(new OptionHelp() {

				@Override
				public Set<String> getOptions() {
					return Collections.singleton(command.getName());
				}

				@Override
				public String getUsageHelp() {
					return command.getDescription();
				}

			});
		}
	}
	return help;
}
 
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:23,代码来源:HelpCommand.java

示例3: CommandCompleter

import org.springframework.boot.cli.command.options.OptionHelp; //导入依赖的package包/类
public CommandCompleter(ConsoleReader consoleReader,
		ArgumentDelimiter argumentDelimiter, Iterable<Command> commands) {
	this.console = consoleReader;
	List<String> names = new ArrayList<String>();
	for (Command command : commands) {
		this.commands.add(command);
		names.add(command.getName());
		List<String> options = new ArrayList<String>();
		for (OptionHelp optionHelp : command.getOptionsHelp()) {
			options.addAll(optionHelp.getOptions());
		}
		AggregateCompleter arguementCompleters = new AggregateCompleter(
				new StringsCompleter(options), new FileNameCompleter());
		ArgumentCompleter argumentCompleter = new ArgumentCompleter(argumentDelimiter,
				arguementCompleters);
		argumentCompleter.setStrict(false);
		this.commandCompleters.put(command.getName(), argumentCompleter);
	}
	getStrings().addAll(names);
}
 
开发者ID:Nephilim84,项目名称:contestparser,代码行数:21,代码来源:CommandCompleter.java

示例4: OptionHelpLine

import org.springframework.boot.cli.command.options.OptionHelp; //导入依赖的package包/类
OptionHelpLine(OptionHelp optionHelp) {
	StringBuilder options = new StringBuilder();
	for (String option : optionHelp.getOptions()) {
		options.append(options.length() == 0 ? "" : ", ");
		options.append(option);
	}
	this.options = options.toString();
	this.usage = optionHelp.getUsageHelp();
}
 
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:10,代码来源:CommandCompleter.java

示例5: showCommandOptionHints

import org.springframework.boot.cli.command.options.OptionHelp; //导入依赖的package包/类
private void showCommandOptionHints(String commandName,
		List<String> specifiedArguments, String starting) {
	Command command = this.commandRunner.findCommand(commandName);
	if (command != null) {
		for (OptionHelp help : command.getOptionsHelp()) {
			if (!alreadyUsed(help, specifiedArguments)) {
				for (String option : help.getOptions()) {
					if (option.startsWith(starting)) {
						Log.info(option + " " + help.getUsageHelp());
					}
				}
			}
		}
	}
}
 
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:16,代码来源:HintCommand.java

示例6: alreadyUsed

import org.springframework.boot.cli.command.options.OptionHelp; //导入依赖的package包/类
private boolean alreadyUsed(OptionHelp help, List<String> specifiedArguments) {
	for (String argument : specifiedArguments) {
		if (help.getOptions().contains(argument)) {
			return true;
		}
	}
	return false;
}
 
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:9,代码来源:HintCommand.java

示例7: OptionHelpLine

import org.springframework.boot.cli.command.options.OptionHelp; //导入依赖的package包/类
OptionHelpLine(OptionHelp optionHelp) {
	StringBuffer options = new StringBuffer();
	for (String option : optionHelp.getOptions()) {
		options.append(options.length() == 0 ? "" : ", ");
		options.append(option);
	}
	this.options = options.toString();
	this.usage = optionHelp.getUsageHelp();
}
 
开发者ID:Nephilim84,项目名称:contestparser,代码行数:10,代码来源:CommandCompleter.java

示例8: getOptionsHelp

import org.springframework.boot.cli.command.options.OptionHelp; //导入依赖的package包/类
@Override
public Collection<OptionHelp> getOptionsHelp() {
	return Collections.emptyList();
}
 
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:5,代码来源:AbstractCommand.java

示例9: getOptionsHelp

import org.springframework.boot.cli.command.options.OptionHelp; //导入依赖的package包/类
@Override
public Collection<OptionHelp> getOptionsHelp() {
	return this.handler.getOptionsHelp();
}
 
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:5,代码来源:OptionParsingCommand.java

示例10: getOptionsHelp

import org.springframework.boot.cli.command.options.OptionHelp; //导入依赖的package包/类
@Override
public Collection<OptionHelp> getOptionsHelp() {
	return this.command.getOptionsHelp();
}
 
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:5,代码来源:ForkProcessCommand.java

示例11: getOptionsHelp

import org.springframework.boot.cli.command.options.OptionHelp; //导入依赖的package包/类
/**
 * Returns help for each supported option.
 * @return help for each of the command's options
 */
Collection<OptionHelp> getOptionsHelp();
 
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:6,代码来源:Command.java


注:本文中的org.springframework.boot.cli.command.options.OptionHelp类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。