All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.quarkiverse.playpen.client.PlaypenCommand Maven / Gradle / Ivy

The newest version!
package io.quarkiverse.playpen.client;

import java.util.concurrent.Callable;

import io.quarkiverse.playpen.client.local.Local;
import io.quarkiverse.playpen.client.remote.Remote;
import io.quarkiverse.playpen.client.util.BaseCommand;
import io.quarkiverse.playpen.client.util.OutputMixin;
import io.quarkiverse.playpen.utils.PlaypenLogger;
import io.quarkiverse.playpen.utils.PlaypenLoggerFactory;
import io.quarkus.picocli.runtime.annotations.TopCommand;
import picocli.CommandLine;

@TopCommand
@CommandLine.Command(name = "playpen", subcommands = { Local.class, Remote.class })
public class PlaypenCommand extends BaseCommand implements Callable {
    public PlaypenCommand() {
        PlaypenLogger.Factory.instance = new PlaypenLoggerFactory() {
            @Override
            public PlaypenLogger logger(Class clz) {
                return getOutput();
            }
        };
    }

    public OutputMixin getOutput() {
        return output;
    }

    @Override
    public Integer call() throws Exception {
        output.info("@|bold Quarkus Playpen|@");

        spec.commandLine().usage(output.out());

        output.info("");
        output.info("Use \"playpen  --help\" for more information about a given command.");

        return spec.exitCodeOnUsageHelp();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy