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

io.quarkus.cli.plugin.ShellCommand Maven / Gradle / Ivy

There is a newer version: 3.17.0.CR1
Show newest version
package io.quarkus.cli.plugin;

import java.nio.file.Path;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.Callable;

import io.quarkus.cli.common.OutputOptionMixin;
import picocli.CommandLine.Command;

@Command
public class ShellCommand implements PluginCommand, Callable {

    private String name;
    private Path command;
    private OutputOptionMixin output;

    private final List arguments = new ArrayList<>();

    public ShellCommand() {
    }

    public ShellCommand(String name, Path command, OutputOptionMixin output) {
        this.name = name;
        this.command = command;
        this.output = output;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public List getCommand() {
        return List.of(command.toString());
    }

    public List getArguments() {
        return arguments;
    }

    @Override
    public void useArguments(List arguments) {
        this.arguments.clear();
        this.arguments.addAll(arguments);
    }

    public OutputOptionMixin getOutput() {
        return output;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy