@Arguments private List<String> arguments;
.shortName('\u0000') .name("") .description(a.description()) .required(a.required()) .valueSeparator(a.valueSeparator()) .askIfNotSet(a.askIfNotSet()) .addAllDefaultValues(a.defaultValue()) .type(type) .fieldName(field.getName()) .optionType(OptionType.ARGUMENTS) .converter(a.converter()) .completer(a.completer()) .validator(a.validator()) .activator(a.activator()) .parser(a.parser()) .build());
@CommandDefinition(name = "run", description = "") public static class RunCommand implements Command { @Arguments(required = true) private List<Resource> arguments; @Override public CommandResult execute(CommandInvocation commandInvocation) throws CommandException, InterruptedException { if (arguments != null && arguments.size() > 0 && arguments.get(0).isLeaf()) { try { List<String> script = readScriptFile(arguments.get(0)); for (String line : script) { commandInvocation.executeCommand(line + Config.getLineSeparator()); } } catch (Exception ex) { throw new CommandException(ex); } } return CommandResult.SUCCESS; } private List<String> readScriptFile(Resource resource) throws IOException { List<String> lines = new ArrayList<>(); BufferedReader br = new BufferedReader(new InputStreamReader(resource.read())); String line = br.readLine(); while (line != null) { if (line.trim().length() > 0 && !line.trim().startsWith("#")) lines.add(line); line = br.readLine(); } return lines; } }
public class UnAliasCommand implements Command<CommandInvocation> { @Arguments(completer = AliasCompletor.class) private List<String> arguments;
@CommandDefinition(name = "ask", description = "") public static class AskCommand implements Command { @Option(askIfNotSet = true) private String path; @Arguments(askIfNotSet = true) private List<String> args; @Override public CommandResult execute(CommandInvocation commandInvocation) throws CommandException, InterruptedException { commandInvocation.println("path is set to: "+path); if(args != null && args.size() > 0) commandInvocation.println("args[0] is: "+args.get(0)); return CommandResult.SUCCESS; } }
@Arguments private List<Resource> files;
public class Man extends AeshFileDisplayer { @Arguments(completer = ManCompleter.class) private final List<String> manPages;
@Arguments(description = HelpDescriptions.HELP_COMMAND_NAME, completer = CommandCompleter.class) private List<String> command;
private boolean help; @Arguments private List<String> arguments;
private boolean help; @Arguments private List<Resource> arguments;
private CommandInvocation commandInvocation; @Arguments private List<Resource> arguments;
private boolean print; @Arguments(completer = AliasCompletor.class) private List<String> arguments;
private boolean help; @Arguments(completer = FileOptionCompleter.class, converter = FileResourceConverter.class) private List<Resource> arguments;
public class Less extends AeshFileDisplayer { @Arguments List<Resource> arguments;
@Arguments(completer = HelpCompleter.class, activator = ArgActivator.class) private List<String> command;
@Arguments(completer = HelpCompleter.class, activator = ArgActivator.class) private List<String> command;
private boolean noClobber; @Arguments private List<Resource> args;
private boolean verbose; @Arguments private List<Resource> arguments;
@CommandDefinition(name = "foo", description = "") public static class FooFormattedCommand implements Command { @Option(renderer = BarOptionRenderer.class, completer = FooCompletor.class) private String bar; @Option(shortName = 'n', completer = NameTestCompleter.class) private String name; @Arguments private List<String> arguments; @Override public CommandResult execute(CommandInvocation commandInvocation) throws CommandException, InterruptedException { return CommandResult.SUCCESS; } public String getName() { return name; } }
private boolean noCreate; @Arguments private List<Resource> args;