use of org.eclipse.ceylon.common.tools.help.CeylonHelpTool in project ceylon by eclipse.
the class Usage method printSynopsis.
private void printSynopsis(ToolModel<?> toolModel) throws Exception {
if (!validToolName()) {
return;
}
// Call the help tool to generate the usage
out.newline();
out.append(CeylonToolMessages.msg("usage")).newline();
out.flush();
// Can't call rootTool.bootstrap() because that would replace the
// rootTool's toolName, which we need when printing option suggestions
CeylonHelpTool r = new CeylonHelpTool();
r.setToolLoader(rootTool.getPluginLoader());
r.setSynopsis(true);
r.setTool(toolModel);
r.run();
out.newline();
}
use of org.eclipse.ceylon.common.tools.help.CeylonHelpTool in project ceylon by eclipse.
the class TopLevelToolTests method getHelpOutput.
private String getHelpOutput(String toolName) {
StringWriter sw = new StringWriter();
CeylonHelpTool helpTool = new CeylonHelpTool();
helpTool.setToolLoader(toolLoader);
if (toolName != null && !toolName.isEmpty()) {
helpTool.setTool(toolLoader.loadToolModel(toolName));
}
helpTool.setOut(sw);
helpTool.run();
return sw.toString();
}
use of org.eclipse.ceylon.common.tools.help.CeylonHelpTool in project ceylon by eclipse.
the class HelpToolTests method testHelpHelp.
@Test
public void testHelpHelp() {
ToolModel<CeylonHelpTool> model = pluginLoader.loadToolModel("help");
Assert.assertNotNull(model);
CeylonHelpTool tool = pluginFactory.bindArguments(model, getMainTool(), Arrays.asList("help"));
tool.run();
}
use of org.eclipse.ceylon.common.tools.help.CeylonHelpTool in project ceylon by eclipse.
the class HelpToolTests method testHelpCompiler.
@Test
public void testHelpCompiler() {
ToolModel<CeylonHelpTool> model = pluginLoader.loadToolModel("help");
Assert.assertNotNull(model);
CeylonHelpTool tool = pluginFactory.bindArguments(model, getMainTool(), Arrays.asList("compile"));
tool.setToolLoader(pluginLoader);
tool.run();
try {
pluginFactory.bindArguments(model, getMainTool(), Arrays.asList("--", "compile", "--javac="));
Assert.fail();
} catch (OptionArgumentException e) {
Assert.assertEquals("Unexpected argument '--javac=' to command 'help'", e.getMessage());
}
}
use of org.eclipse.ceylon.common.tools.help.CeylonHelpTool in project ceylon by eclipse.
the class HelpToolTests method testHelp.
@Test
public void testHelp() {
ToolModel<CeylonHelpTool> model = pluginLoader.loadToolModel("help");
Assert.assertNotNull(model);
Assert.assertTrue(model.isPorcelain());
CeylonHelpTool tool = pluginFactory.bindArguments(model, getMainTool(), Collections.<String>emptyList());
tool.run();
}
Aggregations