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