Add help texts and update README
This commit is contained in:
parent
fcd0a7ce8c
commit
49c25c97d5
3 changed files with 24 additions and 2 deletions
8
README.md
Normal file
8
README.md
Normal file
|
@ -0,0 +1,8 @@
|
|||
# GSoC 2017 - Jingle File Transfer Demo App
|
||||
File synchronisation via XMPP.
|
||||
|
||||
xmpp_sync has two modes: Master and Slave mode. A client started in master mode will send files
|
||||
out, while clients in slave mode will receive files.
|
||||
|
||||
In order to use the program, you need at least two XMPP accounts (which might be on different
|
||||
servers). I recommend using a server, which supports Socks5 proxies.
|
|
@ -11,12 +11,10 @@ import java.security.NoSuchAlgorithmException;
|
|||
import java.security.NoSuchProviderException;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
import javax.crypto.BadPaddingException;
|
||||
import javax.crypto.IllegalBlockSizeException;
|
||||
import javax.crypto.NoSuchPaddingException;
|
||||
|
||||
import org.jivesoftware.smack.SmackConfiguration;
|
||||
import org.jivesoftware.smack.SmackException;
|
||||
import org.jivesoftware.smack.XMPPConnection;
|
||||
import org.jivesoftware.smack.XMPPException;
|
||||
|
|
|
@ -46,11 +46,13 @@ public class Main {
|
|||
Option debug = Option.builder("d").longOpt("debug").desc("Start in debug mode").build();
|
||||
Option directory = Option.builder("D").longOpt("directory").hasArg().required().desc("Directory to sync").build();
|
||||
Option master = Option.builder("m").longOpt("master").desc("Start in master mode").build();
|
||||
Option help = Option.builder("h").longOpt("help").desc("Display this help text").build();
|
||||
options.addOption(username);
|
||||
options.addOption(password);
|
||||
options.addOption(debug);
|
||||
options.addOption(directory);
|
||||
options.addOption(master);
|
||||
options.addOption(help);
|
||||
return options;
|
||||
}
|
||||
|
||||
|
@ -82,6 +84,11 @@ public class Main {
|
|||
return;
|
||||
}
|
||||
|
||||
if (cmd.hasOption('h')) {
|
||||
formatter.printHelp("client", options, true);
|
||||
return;
|
||||
}
|
||||
|
||||
String username = cmd.getOptionValue('u');
|
||||
String password = cmd.getOptionValue('p');
|
||||
String dir = cmd.getOptionValue('D');
|
||||
|
@ -212,6 +219,15 @@ public class Main {
|
|||
}
|
||||
break;
|
||||
|
||||
case "/help":
|
||||
System.out.println("Available commands: \n" +
|
||||
"/add <user@server.tld>: Add user to roster, or display current roster.\n" +
|
||||
"/sync <user@server.tld>: Add a users device to synced devices or display currently synced devices.\n" +
|
||||
"/trust user@sever.tld: Trust a users OMEMO identities.\n" +
|
||||
"/help: Show this help text.\n" +
|
||||
"/quit: Quit the application.");
|
||||
break;
|
||||
|
||||
case "/quit":
|
||||
((AbstractXMPPConnection) client.connection).disconnect(new Presence(Presence.Type.unavailable, "Shutdown", 100, Presence.Mode.away));
|
||||
break outerloop;
|
||||
|
|
Loading…
Reference in a new issue