MCPcopy Index your code
hub / github.com/apache/avro / run

Method run

lang/java/tools/src/main/java/org/apache/avro/tool/Main.java:63–86  ·  view source on GitHub ↗

Delegates to tool specified on the command-line.

(String[] args)

Source from the content-addressed store, hash-verified

61 * Delegates to tool specified on the command-line.
62 */
63 private int run(String[] args) throws Exception {
64 if (args.length != 0) {
65 Tool tool = tools.get(args[0]);
66 if (tool != null) {
67 return tool.run(System.in, System.out, System.err, Arrays.asList(args).subList(1, args.length));
68 }
69 }
70 System.err.print("Version ");
71 try (InputStream versionInput = Main.class.getClassLoader().getResourceAsStream("VERSION.txt")) {
72 printStream(versionInput);
73 }
74 System.err.print(" of ");
75 try (InputStream noticeInput = Main.class.getClassLoader().getResourceAsStream("META-INF/NOTICE")) {
76 printHead(noticeInput, 5);
77 }
78 System.err.println("----------------");
79
80 System.err.println("Available tools:");
81 for (Tool k : tools.values()) {
82 System.err.printf("%" + maxLen + "s %s\n", k.getName(), k.getShortDescription());
83 }
84
85 return 1;
86 }
87
88 private static void printStream(InputStream in) throws Exception {
89 byte[] buffer = new byte[1024];

Callers

nothing calls this directly

Calls 10

runMethod · 0.95
printStreamMethod · 0.95
printHeadMethod · 0.95
asListMethod · 0.80
getMethod · 0.65
getNameMethod · 0.65
getShortDescriptionMethod · 0.65
printMethod · 0.45
getClassLoaderMethod · 0.45
valuesMethod · 0.45

Tested by

no test coverage detected