use of org.eclipse.ceylon.common.tool.ArgumentModel in project ceylon by eclipse.
the class DocBuilder method buildRootSynopsis.
private SynopsesSection buildRootSynopsis(ToolModel<?> model) {
SynopsesSection synopsis = new SynopsesSection();
synopsis.setTitle(CeylonHelpToolMessages.msg("section.SYNOPSIS"));
List<Synopsis> synopsisList = new ArrayList<>();
{
Synopsis s1 = new Synopsis();
s1.setInvocation(Tools.progName());
OptionModel<Boolean> option = new OptionModel<>();
option.setLongName("version");
option.setArgumentType(ArgumentType.BOOLEAN);
ArgumentModel<Boolean> argument = new ArgumentModel<>();
argument.setMultiplicity(Multiplicity._1);
argument.setType(Boolean.TYPE);
option.setArgument(argument);
// model.getOption("version")));
s1.setOptionsAndArguments(Collections.singletonList(option));
synopsisList.add(s1);
}
{
Synopsis s2 = new Synopsis();
s2.setInvocation(Tools.progName());
ArrayList<Object> args = new ArrayList<Object>(model.getOptions());
args.remove(model.getOption("version"));
/*ArgumentModel<?> options = new ArgumentModel();
options.setMultiplicity(Multiplicity._0_OR_MORE);
options.setName("cey\u2011options");
args.add(options);*/
ArgumentModel<?> command = new ArgumentModel<>();
command.setMultiplicity(Multiplicity._1);
command.setName("command");
args.add(command);
ArgumentModel<?> commandOptions = new ArgumentModel<>();
commandOptions.setMultiplicity(Multiplicity._0_OR_MORE);
commandOptions.setName("command\u2011options");
args.add(commandOptions);
ArgumentModel<?> commandArgs = new ArgumentModel<>();
commandArgs.setMultiplicity(Multiplicity._0_OR_MORE);
commandArgs.setName("command\u2011args");
args.add(commandArgs);
s2.setOptionsAndArguments(args);
synopsisList.add(s2);
}
synopsis.setSynopses(synopsisList);
return synopsis;
}
Aggregations