1 /* 2 * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org> and others 3 * 4 * This program and the accompanying materials are made available under the 5 * terms of the Eclipse Distribution License v. 1.0 which is available at 6 * https://www.eclipse.org/org/documents/edl-v10.php. 7 * 8 * SPDX-License-Identifier: BSD-3-Clause 9 */ 10 11 package org.eclipse.jgit.pgm; 12 13 import static java.lang.annotation.ElementType.TYPE; 14 import static java.lang.annotation.RetentionPolicy.RUNTIME; 15 16 import java.lang.annotation.Retention; 17 import java.lang.annotation.Target; 18 19 /** 20 * Annotation to document a {@link org.eclipse.jgit.pgm.TextBuiltin}. 21 * <p> 22 * This is an optional annotation for TextBuiltin subclasses and it carries 23 * documentation forward into the runtime system describing what the command is 24 * and why users may want to invoke it. 25 */ 26 @Retention(RUNTIME) 27 @Target( { TYPE }) 28 public @interface Command { 29 /** 30 * Get the command name 31 * 32 * @return name the command is invoked as from the command line. If the 33 * (default) empty string is supplied the name will be generated 34 * from the class name. 35 */ 36 public String name() default ""; 37 38 /** 39 * Get command description 40 * 41 * @return one line description of the command's feature set. 42 */ 43 public String usage() default ""; 44 45 /** 46 * If this command is considered to be commonly used 47 * 48 * @return true if this command is considered to be commonly used. 49 */ 50 public boolean common() default false; 51 }