in maven-scm-client/src/main/java/org/apache/maven/scm/client/cli/MavenScmCli.java [100:158]
public static void main(String[] args) {
MavenScmCli cli;
try {
cli = new MavenScmCli();
} catch (Exception ex) {
System.err.println("Error while starting Maven SCM.");
ex.printStackTrace(System.err);
return;
}
String scmUrl;
String command;
if (args.length < 3) {
System.err.println(
"Usage: maven-scm-client <command> <working directory> <scm url> [<scmVersion> [<scmVersionType>]]");
System.err.println("scmVersion is a branch name/tag name/revision number.");
System.err.println(
"scmVersionType can be 'branch', 'tag', 'revision'. " + "The default value is 'revision'.");
return;
}
command = args[0];
// SCM-641
File workingDirectory = new File(args[1]).getAbsoluteFile();
scmUrl = args[2];
ScmVersion scmVersion = null;
if (args.length > 3) {
String version = args[3];
if (args.length > 4) {
String type = args[4];
if ("tag".equals(type)) {
scmVersion = new ScmTag(version);
} else if ("branch".equals(type)) {
scmVersion = new ScmBranch(version);
} else if ("revision".equals(type)) {
scmVersion = new ScmRevision(version);
} else {
throw new IllegalArgumentException("'" + type + "' version type isn't known.");
}
} else {
scmVersion = new ScmRevision(args[3]);
}
}
cli.execute(scmUrl, command, workingDirectory, scmVersion);
cli.stop();
}