1
2
3
4
5
6
7
8
9
10 package org.eclipse.jgit.pgm;
11
12 import org.eclipse.jgit.api.errors.GitAPIException;
13 import org.eclipse.jgit.gitrepo.RepoCommand;
14 import org.kohsuke.args4j.Argument;
15 import org.kohsuke.args4j.Option;
16
17 @Command(common = true, usage = "usage_parseRepoManifest")
18 class Repo extends TextBuiltin {
19
20 @Option(name = "--base-uri", aliases = { "-u" }, usage = "usage_baseUri")
21 private String uri;
22
23 @Option(name = "--groups", aliases = { "-g" }, usage = "usage_groups")
24 private String groups = "default";
25
26 @Argument(required = true, metaVar = "metaVar_path", usage = "usage_pathToXml")
27 private String path;
28
29
30 @Override
31 protected void run() {
32 try {
33 new RepoCommand(db)
34 .setURI(uri)
35 .setPath(path)
36 .setGroups(groups)
37 .call();
38 } catch (GitAPIException e) {
39 throw die(e.getMessage(), e);
40 }
41 }
42 }