Esempio n. 1
0
 public void run() throws SVNException {
   if (!getEnvironment().getArguments().isEmpty()) {
     for (Iterator commands = getEnvironment().getArguments().iterator(); commands.hasNext(); ) {
       String commandName = (String) commands.next();
       AbstractSVNCommand command = AbstractSVNCommand.getCommand(commandName);
       if (command == null) {
         getEnvironment().getErr().println("\"" + commandName + "\": unknown command.\n");
         continue;
       }
       String help =
           SVNCommandUtil.getCommandHelp(command, getEnvironment().getProgramName(), true);
       getEnvironment().getOut().println(help);
     }
   } else if (getSVNLookEnvironment().isVersion()) {
     String version = SVNCommandUtil.getVersion(getEnvironment(), false);
     getEnvironment().getOut().println(version);
     getEnvironment().getOut().println(VERSION_HELP_FOOTER);
   } else if (getEnvironment().getArguments().isEmpty()) {
     String help =
         SVNCommandUtil.getGenericHelp(
             getEnvironment().getProgramName(), GENERIC_HELP_HEADER, null, null);
     getEnvironment().getOut().print(help);
   } else {
     String message =
         MessageFormat.format(
             "Type ''{0} help'' for usage.", new Object[] {getEnvironment().getProgramName()});
     getEnvironment().getOut().println(message);
   }
 }