aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Command.java
blob: 52d5782bddaeaff59c8f788ce06e969c64a58322 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
/*
 * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org> and others
 *
 * This program and the accompanying materials are made available under the
 * terms of the Eclipse Distribution License v. 1.0 which is available at
 * https://www.eclipse.org/org/documents/edl-v10.php.
 *
 * SPDX-License-Identifier: BSD-3-Clause
 */

package org.eclipse.jgit.pgm;

import static java.lang.annotation.ElementType.TYPE;
import static java.lang.annotation.RetentionPolicy.RUNTIME;

import java.lang.annotation.Retention;
import java.lang.annotation.Target;

/**
 * Annotation to document a {@link org.eclipse.jgit.pgm.TextBuiltin}.
 * <p>
 * This is an optional annotation for TextBuiltin subclasses and it carries
 * documentation forward into the runtime system describing what the command is
 * and why users may want to invoke it.
 */
@Retention(RUNTIME)
@Target( { TYPE })
public @interface Command {
	/**
	 * Get the command name
	 *
	 * @return name the command is invoked as from the command line. If the
	 *         (default) empty string is supplied the name will be generated
	 *         from the class name.
	 */
	public String name() default "";

	/**
	 * Get command description
	 *
	 * @return one line description of the command's feature set.
	 */
	public String usage() default "";

	/**
	 * If this command is considered to be commonly used
	 *
	 * @return true if this command is considered to be commonly used.
	 */
	public boolean common() default false;
}