I2P Address: [http://git.idk.i2p]

Skip to content
Snippets Groups Projects
Unverified Commit a6ad5251 authored by zzz's avatar zzz
Browse files

Addressbook: Add CLI

parent 0826b1e2
No related branches found
No related tags found
No related merge requests found
......@@ -9,6 +9,7 @@
<property name="javac.compilerargs" value="" />
<property name="javac.version" value="1.8" />
<property name="javac.release" value="8" />
<property name="manifest.classpath.name" value="Class-Path" />
<target name="all" depends="jar, emptyWar"/>
......@@ -57,8 +58,14 @@
<property name="workspace.changes.tr" value="" />
<jar basedir="${build}" destfile="${dist}/${jar}">
<manifest>
<attribute name="Main-Class" value="net.i2p.addressbook.Daemon"/>
<attribute name="${manifest.classpath.name}" value="i2p.jar" />
<attribute name="Main-Class" value="net.i2p.addressbook.CommandLine"/>
<attribute name="Specification-Title" value="I2P Address Book" />
<attribute name="Specification-Version" value="${api.version}" />
<attribute name="Specification-Vendor" value="The I2P Project https://geti2p.net/" />
<attribute name="Implementation-Title" value="I2P Java Address Book" />
<attribute name="Implementation-Version" value="${full.version}" />
<attribute name="Implementation-Vendor" value="The I2P Project https://geti2p.net/" />
<attribute name="Built-By" value="${build.built-by}" />
<attribute name="Build-Date" value="${build.timestamp}" />
<attribute name="Base-Revision" value="${workspace.version}" />
......
package net.i2p.addressbook;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import net.i2p.CoreVersion;
/**
* Simple command line access to various utilities.
* Not a public API. Subject to change.
* Apps and plugins should use specific classes.
*
* @since 0.9.55
*/
public class CommandLine extends net.i2p.util.CommandLine {
protected static final List<String> ACLASSES = Arrays.asList(new String[] {
"net.i2p.addressbook.HostTxtParser",
"net.i2p.router.naming.BlockfileNamingService",
"net.metanotion.io.block.BlockFile",
});
protected CommandLine() {}
public static void main(String args[]) {
List<String> classes = new ArrayList<String>(ACLASSES.size() + CLASSES.size());
classes.addAll(ACLASSES);
classes.addAll(CLASSES);
if (args.length > 0) {
exec(args, classes);
}
usage(classes);
System.exit(1);
}
private static void usage(List<String> classes) {
System.err.println("I2P Address book version " + CoreVersion.VERSION + '\n' +
"USAGE: java -jar /path/to/addressbook.jar command [args]");
printCommands(classes);
}
}
......@@ -25,9 +25,9 @@ import net.i2p.util.SystemVersion;
* Utility class providing methods to parse and write files in a hosts.txt file
* format, and subscription file format.
*
* @since 0.9.26 modified from ConfigParser
* @since 0.9.26 modified from ConfigParser, public since 0.9.55 for CLI
*/
class HostTxtParser {
public class HostTxtParser {
private static final boolean isWindows = SystemVersion.isWindows();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment