1 22 package org.netbeans.lib.cvsclient.commandLine.command; 23 24 import java.io.*; 25 26 import org.netbeans.lib.cvsclient.command.*; 27 import org.netbeans.lib.cvsclient.command.log.*; 28 import org.netbeans.lib.cvsclient.commandLine.*; 29 30 34 public class rlog extends AbstractCommandProvider { 35 36 public String [] getSynonyms() { 37 return new String [] { "rlo" }; } 39 40 public Command createCommand(String [] args, int index, GlobalOptions gopt, String workDir) { 41 RlogCommand command = new RlogCommand(); 42 final String getOptString = command.getOptString(); 43 GetOpt go = new GetOpt(args, getOptString); 44 int ch = -1; 45 go.optIndexSet(index); 46 boolean usagePrint = false; 47 String arg; 48 while ((ch = go.getopt()) != go.optEOF) { 49 boolean ok = command.setCVSCommand((char)ch, go.optArgGet()); 50 if (!ok) { 51 usagePrint = true; 52 } 53 } 54 if (usagePrint) { 55 throw new IllegalArgumentException (getUsage()); 56 } 57 int modulesArgsIndex = go.optIndexGet(); 58 if (modulesArgsIndex < args.length) { 60 String [] modulesArgs = new String [args.length - modulesArgsIndex]; 61 for (int i = modulesArgsIndex; i < args.length; i++) { 63 modulesArgs[i - modulesArgsIndex] = args[i]; 64 } 65 command.setModules(modulesArgs); 66 } 67 return command; 68 } 69 70 } | Popular Tags |