1 19 20 package org.netbeans.lib.cvsclient.commandLine.command; 21 22 import java.io.File ; 23 import java.util.ResourceBundle ; 24 25 import org.netbeans.lib.cvsclient.command.*; 26 import org.netbeans.lib.cvsclient.command.export.*; 27 import org.netbeans.lib.cvsclient.commandLine.*; 28 29 34 public class export extends AbstractCommandProvider { 35 36 public String getName() { 37 return "export"; } 39 40 public String [] getSynonyms() { 41 return new String [] { "ex", "exp" }; } 43 44 public Command createCommand(String [] args, int index, GlobalOptions gopt, String workDir) { 45 ExportCommand command = new ExportCommand(); 46 command.setBuilder(null); 47 final String getOptString = command.getOptString(); 48 GetOpt go = new GetOpt(args, getOptString); 49 int ch = -1; 50 go.optIndexSet(index); 51 boolean usagePrint = false; 52 String arg; 53 while ((ch = go.getopt()) != go.optEOF) { 54 boolean ok = command.setCVSCommand((char)ch, go.optArgGet()); 55 if (!ok) { 56 usagePrint = true; 57 } 58 } 59 if (usagePrint) { 60 throw new IllegalArgumentException (getUsage()); 61 } 62 if (command.getExportByDate() == null && command.getExportByRevision() == null) { 63 throw new IllegalArgumentException ("cvs [export]: "+ResourceBundle.getBundle(export.class.getPackage().getName()+".Bundle").getString("export.Msg_NeedTagOrDate")); } 65 int modulesArgsIndex = go.optIndexGet(); 66 if (modulesArgsIndex < args.length) { 68 String [] modulesArgs = new String [args.length - modulesArgsIndex]; 69 for (int i = modulesArgsIndex; i < args.length; i++) { 71 modulesArgs[i - modulesArgsIndex] = args[i]; 72 } 73 command.setModules(modulesArgs); 74 } 75 return command; 76 77 } 78 79 } 80 | Popular Tags |