com.sshtools.commands.ChildCommand Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of command-utils Show documentation
Show all versions of command-utils Show documentation
Utility classes for creating SSH enabled commands with Maverick Synergy
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;
}