30 lines
1016 B
Java
30 lines
1016 B
Java
package io.gitlab.jfronny.inceptum.frontend.cli.commands;
|
|
|
|
import io.gitlab.jfronny.inceptum.Inceptum;
|
|
import io.gitlab.jfronny.inceptum.WrapperStrap;
|
|
import io.gitlab.jfronny.inceptum.frontend.cli.*;
|
|
|
|
public class WrapperCommand extends Command {
|
|
public WrapperCommand() {
|
|
super("Invokes a command in a wrapper environment", "<command>", "wrapper");
|
|
}
|
|
|
|
@Override
|
|
protected void invoke(CommandArgs args) {
|
|
throw new RuntimeException("Attempted to invoke wrapper command. This should not happen");
|
|
}
|
|
|
|
@Override
|
|
public CommandResolution resolve(CommandArgs args) {
|
|
if (WrapperStrap.class.getClassLoader() == Inceptum.class.getClassLoader()) {
|
|
throw new IllegalStateException("The WrapperStrap classloader does not match the inceptum loader. Are you using the latest wrapper?");
|
|
}
|
|
return Commands.COMMANDS_ROOT.resolve(args);
|
|
}
|
|
|
|
@Override
|
|
public void buildHelp(HelpBuilder builder) {
|
|
// Don't show this in help
|
|
}
|
|
}
|