From edc30a39d6dde1b8bf829b805e1f1e1d095a8ec9 Mon Sep 17 00:00:00 2001 From: csibbitt Date: Mon, 17 Feb 2014 15:58:57 -0500 Subject: [PATCH] Wrote useful help output for -h,--help --- eth/main.cpp | 96 +++++++++++----------------------------------------- 1 file changed, 20 insertions(+), 76 deletions(-) diff --git a/eth/main.cpp b/eth/main.cpp index 7155b1e1b..87b799cbe 100644 --- a/eth/main.cpp +++ b/eth/main.cpp @@ -68,82 +68,26 @@ bool isFalse(std::string const& _m) void help() { cout - << "Usage eth [OPTIONS] " << endl - << "Options:" << endl - << " -l,--listen Listen on the given port for incoming connected (default: 30303)." << endl - << " -l,--listen Listen on the given port for incoming connected (default: 30303)." << endl - << " -l,--listen Listen on the given port for incoming connected (default: 30303)." << endl - ; -/* - if ((arg == "-l" || arg == "--listen" || arg == "--listen-port") && i + 1 < argc) - listenPort = atoi(argv[++i]); - else if ((arg == "-u" || arg == "--public-ip" || arg == "--public") && i + 1 < argc) - publicIP = argv[++i]; - else if ((arg == "-r" || arg == "--remote") && i + 1 < argc) - remoteHost = argv[++i]; - else if ((arg == "-p" || arg == "--port") && i + 1 < argc) - remotePort = atoi(argv[++i]); - else if ((arg == "-n" || arg == "--upnp") && i + 1 < argc) - { - string m = argv[++i]; - if (isTrue(m)) - upnp = true; - else if (isFalse(m)) - upnp = false; - else - { - cerr << "Invalid UPnP option: " << m << endl; - return -1; - } - } - else if ((arg == "-c" || arg == "--client-name") && i + 1 < argc) - clientName = argv[++i]; - else if ((arg == "-a" || arg == "--address" || arg == "--coinbase-address") && i + 1 < argc) - coinbase = h160(fromUserHex(argv[++i])); - else if ((arg == "-s" || arg == "--secret") && i + 1 < argc) - us = KeyPair(h256(fromUserHex(argv[++i]))); - else if (arg == "-i" || arg == "--interactive") - interactive = true; - else if ((arg == "-d" || arg == "--path" || arg == "--db-path") && i + 1 < argc) - dbPath = argv[++i]; - else if ((arg == "-m" || arg == "--mining") && i + 1 < argc) - { - string m = argv[++i]; - if (isTrue(m)) - mining = ~(eth::uint)0; - else if (isFalse(m)) - mining = 0; - else if (int i = stoi(m)) - mining = i; - else - { - cerr << "Unknown mining option: " << m << endl; - return -1; - } - } - else if ((arg == "-v" || arg == "--verbosity") && i + 1 < argc) - g_logVerbosity = atoi(argv[++i]); - else if ((arg == "-x" || arg == "--peers") && i + 1 < argc) - peers = atoi(argv[++i]); - else if ((arg == "-o" || arg == "--mode") && i + 1 < argc) - { - string m = argv[++i]; - if (m == "full") - mode = NodeMode::Full; - else if (m == "peer") - mode = NodeMode::PeerServer; - else - { - cerr << "Unknown mode: " << m << endl; - return -1; - } - } - else if (arg == "-h" || arg == "--help") - help(); - else if (arg == "-V" || arg == "--version") - version(); -*/ - exit(0); + << "Usage eth [OPTIONS] " << endl + << "Options:" << endl + << " -a,--address Set the coinbase (mining payout) address to addr (default: auto)." << endl + << " -c,--client-name Add a name to your client's version string (default: blank)." << endl + << " -d,--db-path Load database from path (default: ~/.ethereum " << endl + << " /Etherum or Library/Application Support/Ethereum)." << endl + << " -h,--help Show this help message and exit." << endl + << " -i,--interactive Enter interactive mode (default: non-interactive)." << endl + << " -l,--listen Listen on the given port for incoming connected (default: 30303)." << endl + << " -m,--mining Enable mining, optionally until a specified block number (Default: off)" << endl + << " -n,--upnp Use upnp for NAT (default: on)." << endl + << " -o,--mode Start a full node or a peer node (Default: full)." << endl + << " -p,--port Connect to remote port (default: 30303)." << endl + << " -r,--remote Connect to remote host (default: none)." << endl + << " -s,--secret Set the secret key for use with send command (default: auto)." << endl + << " -u,--public-ip Force public ip to given (default; auto)." << endl + << " -v,--verbosity <0 - 9> Set the log verbosity from 0 to 9 (Default: 8)." << endl + << " -x,--peers Attempt to connect to given number of peers (Default: 5)." << endl + << " -V,--version Show the version and exit." << endl; + exit(0); } void version()