4
0
Fork 0
mirror of https://github.com/Anvilcraft/modpacktools synced 2024-06-02 18:49:31 +02:00
modpacktools/src/main/kotlin/ley/anvil/modpacktools/command/ICommand.kt
LordMZTE a5d5562d93 improve docs
remove mergeTo function due to stdlib containing alternative
getModMetas now takes predicate
2020-08-15 20:49:29 +02:00

48 lines
1.2 KiB
Kotlin

package ley.anvil.modpacktools.command
import net.sourceforge.argparse4j.inf.ArgumentParser
import net.sourceforge.argparse4j.inf.Namespace
/**
* This must be implemented by all commands
*/
interface ICommand {
/**
* Executes this Command
*
* @param args Arguments for the Command
* @return If the Command was executed successful
*/
fun execute(args: Namespace): CommandReturn
/**
* The [ArgumentParser] which will be used to parse the arguments for this command by the [CommandLoader]
*/
val parser: ArgumentParser
/**
* this is the name of the command
* should be lower case and separated by _
*/
val name: String
/**
* This message will be displayed in the help dialog
*/
val helpMessage: String
get() = ""
/**
* If this command needs the config file to be present.
* the command should not run if this returns true and there is no config file
*/
val needsConfig: Boolean
get() = true
/**
* If this returns true, the command should not run if the modpackjson file doesn't exist
*/
val needsModpackjson: Boolean
get() = true
}