/** * Return a command object to execute a {@code Add} command * * @see <a href= * "http://www.kernel.org/pub/software/scm/git/docs/git-add.html" >Git * documentation about Add</a> * @return a {@link org.eclipse.jgit.api.AddCommand} used to collect all * optional parameters and to finally execute the {@code Add} * command */ public AddCommand add() { return new AddCommand(repo); }
/** * Returns a command object to execute a {@code Add} command * * @see <a * href="http://www.kernel.org/pub/software/scm/git/docs/git-add.html" * >Git documentation about Add</a> * @return a {@link AddCommand} used to collect all optional parameters and * to finally execute the {@code Add} command */ public AddCommand add() { return new AddCommand(repo); }
/** * Return a command object to execute a {@code Add} command * * @see <a href= * "http://www.kernel.org/pub/software/scm/git/docs/git-add.html" >Git * documentation about Add</a> * @return a {@link org.eclipse.jgit.api.AddCommand} used to collect all * optional parameters and to finally execute the {@code Add} * command */ public AddCommand add() { return new AddCommand(repo); }
AddCommand add = new AddCommand(repo);
public class Main { private static Map<String, Command> commands = new HashMap<String, Command>(); private static void init() { Command addCommand = new AddCommand(); commands.put(addCommand.getCommandName(), addCommand); } public static void main (String[] args) { init(); if (args[0] != null) { Command command = commands.get(args[0]); if (command != null) { System.out.println(command.doAction()); } else { System.out.println("Command not found"); } } }
AddCommand add = new AddCommand(repo);
AddCommand add = new AddCommand(repo);