package io.gitlab.jfronny.inceptum.cli; import java.util.Arrays; import java.util.List; import java.util.Locale; public abstract class Command { private final String help; private final List aliases; public Command(String help, String... aliases) { this.help = help; this.aliases = Arrays.asList(aliases); } public boolean isAlias(String text) { return aliases.contains(text.replaceAll("^[-/]*", "").toLowerCase(Locale.ROOT)); } public String getName() { return aliases.get(0); } public String getHelp() { return help; } public boolean enableLog() { return false; } public abstract void invoke(InvokedCommandDescription args); }