use of com.github.jankroken.commandline.annotations.AllAvailableArguments in project POL-POM-5 by PlayOnLinux.
the class CLIController method runScript.
@Option
@LongSwitch("script")
@ShortSwitch("s")
@AllAvailableArguments
public void runScript(List<String> arguments) {
final String scriptPath = arguments.get(0);
final File scriptFile = new File(scriptPath);
final ScriptInterpreter scriptInterpreter = applicationContext.getBean("scriptInterpreter", ScriptInterpreter.class);
scriptInterpreter.runScript(scriptFile, e -> {
throw new IllegalStateException(e);
});
}
use of com.github.jankroken.commandline.annotations.AllAvailableArguments in project POL-POM-5 by PlayOnLinux.
the class CLIController method installApp.
@Option
@LongSwitch("install")
@ShortSwitch("i")
@AllAvailableArguments
public void installApp(List<String> arguments) {
final String categoryName = arguments.get(0);
final String appName = arguments.get(1);
final String scriptName = arguments.get(2);
final ScriptDTO scriptDTO = repositoryManager.getScript(Arrays.asList(categoryName, appName, scriptName));
scriptInterpreter.runScript(scriptDTO.getScript(), Throwable::printStackTrace);
}
use of com.github.jankroken.commandline.annotations.AllAvailableArguments in project POL-POM-5 by PlayOnLinux.
the class CLIController method runApp.
@Option
@LongSwitch("run")
@ShortSwitch("r")
@AllAvailableArguments
public void runApp(List<String> arguments) {
final String shortcutName = arguments.get(0);
arguments.remove(0);
final ShortcutRunner shortcutRunner = applicationContext.getBean(ShortcutRunner.class);
shortcutRunner.run(shortcutName, arguments, e -> {
throw new IllegalStateException(e);
});
}
Aggregations