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

com.sshtools.commands.ChildCommand Maven / Gradle / Ivy

The newest version!
package com.sshtools.commands;

import java.util.concurrent.Callable;

import picocli.CommandLine.Command;
import picocli.CommandLine.Model.CommandSpec;
import picocli.CommandLine.Spec;

@Command
public abstract class ChildCommand implements Callable {

	@Spec
	private CommandSpec spec;

	protected CommandSpec getSpec() {
		return spec;
	}

	@Override
	public final Integer call() throws Exception {
		getRootCommand().initCommand();
		return onCall();
	}

	protected SshCommand getRootCommand() {
		return JadaptiveCommand.getRootCommand(getSpec());
	}

	protected abstract Integer onCall() throws Exception;

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy