Changeset 936f2bb


Ignore:
Timestamp:
Feb 4, 2014 2:32:36 PM (6 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
839bd51
Parents:
0cd7742
Message:

combine help strings

File:
1 edited

Legend:

Unmodified
Added
Removed
  • apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnel.java

    r0cd7742 r936f2bb  
    313313     */
    314314    private static void runHelp(Logging l) {
    315         l.log("Command list:");
     315        l.log("Command list:\n" +
    316316        // alphabetical please...
    317         l.log("  auth <username> <password>");
    318         l.log("  client <port> <pubkey>[,<pubkey,...]|file:<pubkeyfile> [<sharedClient>]");
    319         l.log("  clientoptions [-acx] [key=value ]*");
    320         l.log("  close [forced] <jobnumber>|all");
    321         l.log("  config [-s] <i2phost> <i2pport>");
    322         l.log("  connectclient <port> [<sharedClient>] [<proxy>]");
    323         l.log("  genkeys <privkeyfile> [<pubkeyfile>]");
    324         l.log("  gentextkeys");
    325         l.log("  httpbidirserver <host> <port> <proxyport> <spoofedhost> <privkeyfile>");
    326         l.log("  httpclient <port> [<sharedClient>] [<proxy>]");
    327         l.log("  httpserver <host> <port> <spoofedhost> <privkeyfile>");
    328         l.log("  ircclient <port> <pubkey>[,<pubkey,...]|file:<pubkeyfile> [<sharedClient>]");
    329         l.log("  list");
    330         l.log("  listen_on <ip>");
    331         l.log("  lookup <name>");
    332         l.log("  owndest yes|no");
    333         l.log("  ping <args>");
    334         l.log("  quit");
    335         l.log("  read_timeout <msecs>");
    336         l.log("  run <commandfile>");
    337         l.log("  server <host> <port> <privkeyfile>");
    338         l.log("  textserver <host> <port> <privkey>");
     317              "  auth <username> <password>\n" +
     318              "  client <port> <pubkey>[,<pubkey,...]|file:<pubkeyfile> [<sharedClient>]\n" +
     319              "  clientoptions [-acx] [key=value ]*\n" +
     320              "  close [forced] <jobnumber>|all\n" +
     321              "  config [-s] <i2phost> <i2pport>\n" +
     322              "  connectclient <port> [<sharedClient>] [<proxy>]\n" +
     323              "  genkeys <privkeyfile> [<pubkeyfile>]\n" +
     324              "  gentextkeys\n" +
     325              "  httpbidirserver <host> <port> <proxyport> <spoofedhost> <privkeyfile>\n" +
     326              "  httpclient <port> [<sharedClient>] [<proxy>]\n" +
     327              "  httpserver <host> <port> <spoofedhost> <privkeyfile>\n" +
     328              "  ircclient <port> <pubkey>[,<pubkey,...]|file:<pubkeyfile> [<sharedClient>]\n" +
     329              "  list\n" +
     330              "  listen_on <ip>\n" +
     331              "  lookup <name>\n" +
     332              "  owndest yes|no\n" +
     333              "  ping <args>\n" +
     334              "  quit\n" +
     335              "  read_timeout <msecs>\n" +
     336              "  run <commandfile>\n" +
     337              "  server <host> <port> <privkeyfile>\n" +
     338              "  textserver <host> <port> <privkey>\n");
    339339    }
    340340   
     
    379379            }
    380380        } else {
    381             l.log("Usage:");
    382             l.log("  clientoptions [key=value ]*     // sets current options");
    383             l.log("  clientoptions -a [key=value ]*  // adds to current options");
    384             l.log("  clientoptions -c                // clears current options");
    385             l.log("  clientoptions -x [key ]*        // removes listed options");
    386             l.log("Current options:");
     381            l.log("Usage:\n" +
     382                  "  clientoptions [key=value ]*     // sets current options\n" +
     383                  "  clientoptions -a [key=value ]*  // adds to current options\n" +
     384                  "  clientoptions -c                // clears current options\n" +
     385                  "  clientoptions -x [key ]*        // removes listed options\n" +
     386                  "Current options:\n");
    387387            Properties p = new OrderedProperties();
    388388            p.putAll(_clientOptions);
     
    467467            return;
    468468        } else {
    469             l.log("server <host> <port> <privkeyfile>");
    470             l.log("  creates a server that sends all incoming data\n" + "  of its destination to host:port.");
     469            l.log("server <host> <port> <privkeyfile>\n" +
     470                  "  creates a server that sends all incoming data\n" + "  of its destination to host:port.");
    471471            notifyEvent("serverTaskId", Integer.valueOf(-1));
    472472        }
     
    518518            return;
    519519        } else {
    520             l.log("server <host> <port> <privkeyfile>");
    521             l.log("  creates a server that sends all incoming data\n" + "  of its destination to host:port.");
     520            l.log("server <host> <port> <privkeyfile>\n" +
     521                  "  creates a server that sends all incoming data\n" + "  of its destination to host:port.");
    522522            notifyEvent("serverTaskId", Integer.valueOf(-1));
    523523        }
     
    579579            return;
    580580        } else {
    581             l.log("httpserver <host> <port> <spoofedhost> <privkeyfile>");
    582             l.log("  creates an HTTP server that sends all incoming data\n"
     581            l.log("httpserver <host> <port> <spoofedhost> <privkeyfile>\n" +
     582                  "  creates an HTTP server that sends all incoming data\n"
    583583                  + "  of its destination to host:port., filtering the HTTP\n"
    584584                  + "  headers so it looks like the request is to the spoofed host.");
     
    655655            return;
    656656        } else {
    657             l.log("httpserver <host> <port> <proxyport> <spoofedhost> <privkeyfile>");
    658             l.log("  creates a bidirectional HTTP server that sends all incoming data\n"
     657            l.log("httpserver <host> <port> <proxyport> <spoofedhost> <privkeyfile>\n" +
     658                  "  creates a bidirectional HTTP server that sends all incoming data\n"
    659659                  + "  of its destination to host:port., filtering the HTTP\n"
    660660                  + "  headers so it looks like the request is to the spoofed host,"
     
    708708            notifyEvent("serverTaskId", Integer.valueOf(serv.getId()));
    709709        } else {
    710             l.log("textserver <host> <port> <privkey>");
    711             l.log("  creates a server that sends all incoming data\n" + "  of its destination to host:port.");
     710            l.log("textserver <host> <port> <privkey>\n" +
     711                  "  creates a server that sends all incoming data\n" + "  of its destination to host:port.");
    712712            notifyEvent("textserverTaskId", Integer.valueOf(-1));
    713713        }
     
    766766            }
    767767        } else {
    768             l.log("client <port> <pubkey>[,<pubkey>]|file:<pubkeyfile>[ <sharedClient>] [<privKeyFile>]");
    769             l.log("  creates a client that forwards port to the pubkey.\n"
     768            l.log("client <port> <pubkey>[,<pubkey>]|file:<pubkeyfile>[ <sharedClient>] [<privKeyFile>]\n" +
     769                  "  creates a client that forwards port to the pubkey.\n"
    770770                  + "  use 0 as port to get a free port assigned.  If you specify\n"
    771771                  + "  a comma delimited list of pubkeys, it will rotate among them\n"
     
    842842            }
    843843        } else {
    844             l.log("httpclient <port> [<sharedClient>] [<proxy>]");
    845             l.log("  creates a client that distributes HTTP requests.");
    846             l.log("  <sharedClient> (optional) indicates if this client shares tunnels with other clients (true of false)");
    847             l.log("  <proxy> (optional) indicates a proxy server to be used");
    848             l.log("  when trying to access an address out of the .i2p domain");
     844            l.log("httpclient <port> [<sharedClient>] [<proxy>]\n" +
     845                  "  creates a client that distributes HTTP requests.\n" +
     846                  "  <sharedClient> (optional) indicates if this client shares tunnels with other clients (true of false)\n" +
     847                  "  <proxy> (optional) indicates a proxy server to be used\n" +
     848                  "  when trying to access an address out of the .i2p domain");
    849849            notifyEvent("httpclientTaskId", Integer.valueOf(-1));
    850850        }
     
    909909            }
    910910        } else {
    911             l.log("connectclient <port> [<sharedClient>] [<proxy>]");
    912             l.log("  creates a client that for SSL/HTTPS requests.");
    913             l.log("  <sharedClient> (optional) indicates if this client shares tunnels with other clients (true of false)");
    914             l.log("  <proxy> (optional) indicates a proxy server to be used");
    915             l.log("  when trying to access an address out of the .i2p domain");
     911            l.log("connectclient <port> [<sharedClient>] [<proxy>]\n" +
     912                  "  creates a client that for SSL/HTTPS requests.\n" +
     913                  "  <sharedClient> (optional) indicates if this client shares tunnels with other clients (true of false)\n" +
     914                  "  <proxy> (optional) indicates a proxy server to be used\n" +
     915                  "  when trying to access an address out of the .i2p domain\n");
    916916        }
    917917    }
     
    976976            }
    977977        } else {
    978             l.log("ircclient <port> [<sharedClient> [<privKeyFile>]]");
    979             l.log("  creates a client that filter IRC protocol.");
    980             l.log("  <sharedClient> (optional) indicates if this client shares tunnels with other clients (true of false)");
     978            l.log("ircclient <port> [<sharedClient> [<privKeyFile>]]\n" +
     979                  "  creates a client that filter IRC protocol.\n" +
     980                  "  <sharedClient> (optional) indicates if this client shares tunnels with other clients (true of false)\n");
    981981            notifyEvent("ircclientTaskId", Integer.valueOf(-1));
    982982        }
     
    10291029            }
    10301030        } else {
    1031             l.log("sockstunnel <port>");
    1032             l.log("  creates a tunnel that distributes SOCKS requests.");
     1031            l.log("sockstunnel <port>\n" +
     1032                  "  creates a tunnel that distributes SOCKS requests.");
    10331033            notifyEvent("sockstunnelTaskId", Integer.valueOf(-1));
    10341034        }
     
    10761076            }
    10771077        } else {
    1078             l.log("socksirctunnel <port> [<sharedClient> [<privKeyFile>]]");
    1079             l.log("  creates a tunnel for SOCKS IRC.");
     1078            l.log("socksirctunnel <port> [<sharedClient> [<privKeyFile>]]\n" +
     1079                  "  creates a tunnel for SOCKS IRC.");
    10801080            notifyEvent("sockstunnelTaskId", Integer.valueOf(-1));
    10811081        }
     
    11261126            }
    11271127        } else {
    1128             l.log("streamrclient <host> <port> <destination>");
    1129             l.log("  creates a tunnel that receives streaming data.");
     1128            l.log("streamrclient <host> <port> <destination>\n" +
     1129                  "  creates a tunnel that receives streaming data.");
    11301130            notifyEvent("streamrtunnelTaskId", Integer.valueOf(-1));
    11311131        }
     
    11671167            notifyEvent("streamrtunnelTaskId", Integer.valueOf(task.getId()));
    11681168        } else {
    1169             l.log("streamrserver <port> <privkeyfile>");
    1170             l.log("  creates a tunnel that sends streaming data.");
     1169            l.log("streamrserver <port> <privkeyfile>\n" +
     1170                  "  creates a tunnel that sends streaming data.");
    11711171            notifyEvent("streamrtunnelTaskId", Integer.valueOf(-1));
    11721172        }
     
    11961196            notifyEvent("configResult", "ok");
    11971197        } else {
    1198             l.log("Usage:");
    1199             l.log("  config [-s] <i2phost> <i2pport>");
    1200             l.log("  sets the connection to the i2p router.");
    1201             l.log("Current setting:");
    12021198            boolean ssl = Boolean.parseBoolean(_clientOptions.getProperty("i2cp.SSL"));
    1203             l.log("  " + host + ' ' + port + (ssl ? " SSL" : ""));
     1199            l.log("Usage:\n" +
     1200                  "  config [-s] <i2phost> <i2pport>\n" +
     1201                  "  sets the connection to the i2p router.\n" +
     1202                  "Current setting:\n" +
     1203                  "  " + host + ' ' + port + (ssl ? " SSL" : ""));
    12041204            notifyEvent("configResult", "error");
    12051205        }
     
    12181218            _clientOptions.setProperty("i2cp.password", args[1]);
    12191219        } else {
    1220             l.log("Usage:");
    1221             l.log("  auth <username> <password>");
    1222             l.log("  Sets the i2cp credentials");
     1220            l.log("Usage:\n" +
     1221                  "  auth <username> <password>\n" +
     1222                  "  Sets the i2cp credentials");
    12231223        }
    12241224    }
     
    12381238            notifyEvent("owndestResult", "ok");
    12391239        } else {
    1240             l.log("owndest yes|no");
    1241             l.log("  Specifies whether to use its own destination \n" + "  for each outgoing tunnel");
     1240            l.log("owndest yes|no\n" +
     1241                  "  Specifies whether to use its own destination \n" + "  for each outgoing tunnel");
    12421242            notifyEvent("owndestResult", "error");
    12431243        }
     
    12571257            notifyEvent("listen_onResult", "ok");
    12581258        } else {
    1259             l.log("listen_on <ip>");
    1260             l.log("  sets the interface to listen for the I2PClient.");
     1259            l.log("listen_on <ip>\n" +
     1260                  "  sets the interface to listen for the I2PClient.");
    12611261            notifyEvent("listen_onResult", "error");
    12621262        }
     
    12801280            notifyEvent("read_timeoutResult", "ok");
    12811281        } else {
    1282             l.log("read_timeout <msecs>");
    1283             l.log("  sets the read timeout (in milliseconds) for I2P connections\n"
     1282            l.log("read_timeout <msecs>\n" +
     1283                  "  sets the read timeout (in milliseconds) for I2P connections\n"
    12841284                  +"  Negative values will make the connections wait forever");
    12851285            notifyEvent("read_timeoutResult", "error");
     
    13081308            }
    13091309        } else if (args.length != 1) {
    1310             l.log("genkeys <privkeyfile> [<pubkeyfile>]");
    1311             l.log("   creates a new keypair and prints the public key.\n"
     1310            l.log("genkeys <privkeyfile> [<pubkeyfile>]\n" +
     1311                  "   creates a new keypair and prints the public key.\n"
    13121312                  + "   if pubkeyfile is given, saves the public key there." + "\n"
    13131313                  + "   if the privkeyfile already exists, just print/save" + "the pubkey.");
     
    13951395    public void runClose(String args[], Logging l) {
    13961396        if (args.length == 0 || args.length > 2) {
    1397             l.log("close [forced] <jobnumber>|all");
    1398             l.log("   stop running tasks. either only one or all.\n"
     1397            l.log("close [forced] <jobnumber>|all\n" +
     1398                  "   stop running tasks. either only one or all.\n"
    13991399                  + "   use 'forced' to also stop tasks with active connections.\n"
    14001400                  + "   use the 'list' command to show the job numbers");
     
    14571457            }
    14581458        } else {
    1459             l.log("run <commandfile>");
    1460             l.log("   loads commandfile and runs each line in it. \n"
     1459            l.log("run <commandfile>\n" +
     1460                  "   loads commandfile and runs each line in it. \n"
    14611461                  + "   You can also give the filename on the commandline.");
    14621462            notifyEvent("runResult", "error");
     
    14751475    private void runLookup(String args[], Logging l) {
    14761476        if (args.length != 1) {
    1477             l.log("lookup <name>");
    1478             l.log("   try to resolve the name into a destination key");
     1477            l.log("lookup <name>\n" +
     1478                  "   try to resolve the name into a destination key");
    14791479            notifyEvent("lookupResult", "invalidUsage");
    14801480        } else {
     
    15981598            I2PClient client = I2PClientFactory.createClient();
    15991599            Destination d = client.createDestination(writeTo);
    1600             l.log("Secret key saved.");
    1601             l.log("Public key: " + d.toBase64());
     1600            l.log("Secret key saved.\n" +
     1601                  "Public key: " + d.toBase64());
    16021602            writeTo.flush();
    16031603            writeTo.close();
Note: See TracChangeset for help on using the changeset viewer.