Search in sources :

Example 1 with ShortcutRunner

use of org.phoenicis.library.ShortcutRunner in project POL-POM-5 by PhoenicisOrg.

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);
    });
}
Also used : ShortcutRunner(org.phoenicis.library.ShortcutRunner) ShortSwitch(com.github.jankroken.commandline.annotations.ShortSwitch) Option(com.github.jankroken.commandline.annotations.Option) LongSwitch(com.github.jankroken.commandline.annotations.LongSwitch) AllAvailableArguments(com.github.jankroken.commandline.annotations.AllAvailableArguments)

Example 2 with ShortcutRunner

use of org.phoenicis.library.ShortcutRunner in project phoenicis by PhoenicisOrg.

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);
    });
}
Also used : ShortcutRunner(org.phoenicis.library.ShortcutRunner) ShortSwitch(com.github.jankroken.commandline.annotations.ShortSwitch) Option(com.github.jankroken.commandline.annotations.Option) LongSwitch(com.github.jankroken.commandline.annotations.LongSwitch) AllAvailableArguments(com.github.jankroken.commandline.annotations.AllAvailableArguments)

Example 3 with ShortcutRunner

use of org.phoenicis.library.ShortcutRunner 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);
    if (!shortcutRunner.shortcutExists(shortcutName)) {
        LOGGER.error("Requested shortcut does not exist: " + shortcutName);
        return;
    }
    shortcutRunner.run(shortcutName, arguments, e -> {
        throw new IllegalStateException(e);
    });
}
Also used : ShortcutRunner(org.phoenicis.library.ShortcutRunner) ShortSwitch(com.github.jankroken.commandline.annotations.ShortSwitch) Option(com.github.jankroken.commandline.annotations.Option) LongSwitch(com.github.jankroken.commandline.annotations.LongSwitch) AllAvailableArguments(com.github.jankroken.commandline.annotations.AllAvailableArguments)

Aggregations

AllAvailableArguments (com.github.jankroken.commandline.annotations.AllAvailableArguments)3 LongSwitch (com.github.jankroken.commandline.annotations.LongSwitch)3 Option (com.github.jankroken.commandline.annotations.Option)3 ShortSwitch (com.github.jankroken.commandline.annotations.ShortSwitch)3 ShortcutRunner (org.phoenicis.library.ShortcutRunner)3