2011-01-29 10:05:22 +00:00
|
|
|
// $Id$
|
|
|
|
/*
|
|
|
|
* Copyright (C) 2010 sk89q <http://www.sk89q.com>
|
|
|
|
*
|
|
|
|
* This program is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
2011-02-18 06:53:44 +00:00
|
|
|
package com.sk89q.minecraft.util.commands;
|
2011-01-29 10:05:22 +00:00
|
|
|
|
|
|
|
import java.lang.annotation.Retention;
|
|
|
|
import java.lang.annotation.RetentionPolicy;
|
|
|
|
|
2011-02-25 00:39:23 +00:00
|
|
|
/**
|
|
|
|
* This annotation indicates a command. Methods should be marked with this
|
|
|
|
* annotation to tell {@link CommandsManager} that the method is a command.
|
|
|
|
* Note that the method name can actually be anything.
|
|
|
|
*
|
|
|
|
* @author sk89q
|
|
|
|
*/
|
2011-01-29 10:05:22 +00:00
|
|
|
@Retention(RetentionPolicy.RUNTIME)
|
|
|
|
public @interface Command {
|
2011-02-25 00:39:23 +00:00
|
|
|
/**
|
|
|
|
* A list of aliases for the command. The first alias is the most
|
|
|
|
* important -- it is the main name of the command. (The method name
|
|
|
|
* is never used for anything).
|
|
|
|
*/
|
2011-01-29 10:05:22 +00:00
|
|
|
String[] aliases();
|
2011-02-25 00:39:23 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Usage instruction. Example text for usage could be
|
|
|
|
* <code>[-h] [name] [message]</code>.
|
|
|
|
*/
|
2011-02-01 10:03:18 +00:00
|
|
|
String usage() default "";
|
2011-02-25 00:39:23 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* A short description for the command.
|
|
|
|
*/
|
2011-01-29 10:05:22 +00:00
|
|
|
String desc();
|
2011-02-25 00:39:23 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* The minimum number of arguments. This should be 0 or above.
|
|
|
|
*/
|
2011-02-01 10:03:18 +00:00
|
|
|
int min() default 0;
|
2011-02-25 00:39:23 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* The maximum number of arguments. Use -1 for an unlimited number
|
|
|
|
* of arguments.
|
|
|
|
*/
|
2011-02-01 10:03:18 +00:00
|
|
|
int max() default -1;
|
2011-02-25 00:39:23 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Flags allow special processing for flags such as -h in the command,
|
|
|
|
* allowing users to easily turn on a flag. This is a string with
|
|
|
|
* each character being a flag. Use A-Z and a-z as possible flags.
|
2011-09-14 05:41:19 +00:00
|
|
|
* Appending a flag with a : makes the flag character before a value flag,
|
|
|
|
* meaning that if it is given it must have a value
|
2011-02-25 00:39:23 +00:00
|
|
|
*/
|
2011-01-29 19:36:28 +00:00
|
|
|
String flags() default "";
|
2011-08-29 12:44:14 +00:00
|
|
|
|
2011-01-29 10:05:22 +00:00
|
|
|
}
|