This repository was archived by the owner on Oct 28, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Better command line argument handling #3628 #4597
Closed
Closed
Changes from 1 commit
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
d7721df
Tryed to add boost::program_options library
demon1999 e5917bd
Adding a boost::program_options library
demon1999 a4cfdec
Adding client mode(default) options
demon1999 f20ff93
Adding client transacting options and client mining options
demon1999 5f23851
fixing todo
demon1999 0febf63
adding clientNetworking options
demon1999 eb4f786
Rewriting command string arguments in ethvm and eth
demon1999 eb1cd28
Finish of rewriting ethvm
demon1999 7ce58ad
Fixing ethvm/main.cpp and ethkey/main.cpp
demon1999 af0d89a
Fixing eth/main.cpp and rip.cpp and peer.cpp
demon1999 691d0e6
Fixing eth/main.cpp
demon1999 bf58fff
Fixing test/tools/libtesteth/Options.cpp
demon1999 c1f13cb
Fixing codestyle
demon1999 5612846
Deliting useless options
demon1999 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Rewriting command string arguments in ethvm and eth
- Loading branch information
commit eb4f786cb4bdb68753c4c8ab26f7bf0bdb49eb85
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -153,7 +153,7 @@ void help() | |
| << " --only <n> Equivalent to --export-from n --export-to n.\n" | ||
| << " --dont-check Prevent checking some block aspects. Faster importing, but to apply only when the data is known to be valid.\n\n" | ||
| << " --import-snapshot <path> Import blockchain and state data from the Parity Warp Sync snapshot." << endl | ||
| << "General Options:\n" | ||
| << "General Options:\n" | ||
| << " -d,--db-path,--datadir <path> Load database from path (default: " << getDataDir() << ").\n" | ||
| #if ETH_EVMJIT | ||
| << " --vm <vm-kind> Select VM; options are: interpreter, jit or smart (default: interpreter).\n" | ||
|
|
@@ -413,10 +413,10 @@ int main(int argc, char** argv) | |
| clientDefaultMode.add_options() | ||
| ("mainnet", "Use the main network protocol.") | ||
| ("ropsten", "Use the Ropsten testnet.") | ||
| ("private", po::value<string>(), "<name> Use a private chain.") | ||
| ("private", po::value<string>(), "<name> Use a private chain.") | ||
| ("test", "Testing mode: Disable PoW and provide test rpc interface.") | ||
| ("config", po::value<string>(), "<file> Configure specialised blockchain using given JSON information.") | ||
| ("oppose-dao-fork", "Ignore DAO hard fork (default is to participate).") | ||
| ("oppose-dao-fork", "Ignore DAO hard fork (default is to participate).\n") | ||
|
||
| ("mode,o", po::value<string>(), "<full/peer> Start a full node or a peer node (default: full).\n") | ||
| ("json-rpc,j", "Enable JSON-RPC server (default: off).") | ||
| ("ipc", "Enable IPC server (default: on).") | ||
|
|
@@ -466,14 +466,41 @@ int main(int argc, char** argv) | |
| ("port", po::value<short>(), "<port> Connect to the given remote port (default: 30303).") | ||
| ("network-id", po::value<long>(), "<n> Only connect to other hosts with this network id.") | ||
| ("upnp", po::value<string>(), "<on/off> Use UPnP for NAT (default: on).") | ||
| ("peerset", po::value<string>(), "<list> Space delimited list of peers; element format: type:publickey@ipAddress[:port].\n Types:\n default Attempt connection when no other peers are available and pinning is disabled.\n required Keep connected at all times.\n") | ||
| ("peerset", po::value<string>(), "<list> Space delimited list of peers; element format: type:publickey@ipAddress[:port].\n Types:\n default Attempt connection when no other peers are available and pinning is disabled.\n required Keep connected at all times.\n") | ||
| // TODO: | ||
| // << " --trust-peers <filename> Space delimited list of publickeys." << endl | ||
| ("no-discovery", "Disable node discovery, implies --no-bootstrap.") | ||
| ("pin", "Only accept or connect to trusted peers.") | ||
| ("hermit", "Equivalent to --no-discovery --pin.") | ||
| ("sociable", "Force discovery and no pinning.\n") | ||
| ; | ||
| po::options_description importExportMode("Import/export mode"); | ||
| importExportMode.add_options() | ||
| ("from", po::value<string>(), "<n> Export only from block n; n may be a decimal, a '0x' prefixed hash, or 'latest'.") | ||
| ("to", po::value<string>(), "<n> Export only to block n (inclusive); n may be a decimal, a '0x' prefixed hash, or 'latest'.") | ||
| ("only", po::value<string>(), "<n> Equivalent to --export-from n --export-to n.") | ||
| ("dont-check", "Prevent checking some block aspects. Faster importing, but to apply only when the data is known to be valid.\n") | ||
| ("import-snapshot", po::value<string>(), "<path> Import blockchain and state data from the Parity Warp Sync snapshot.") | ||
| ; | ||
| po::options_description generalOptions("General Options"); | ||
| generalOptions.add_options() | ||
| //TODO " -d,--db-path,--datadir <path> Load database from path (default: " << getDataDir() << ").\n" | ||
| //TODO #if ETH_EVMJIT | ||
| //TODO << " --vm <vm-kind> Select VM; options are: interpreter, jit or smart (default: interpreter).\n" | ||
| //TODO #endif // ETH_EVMJIT | ||
| ("verbosity,v", po::value<int>(), "<0 - 9> Set the log verbosity from 0 to 9 (default: 8).") | ||
| ("version,V", "Show the version and exit.") | ||
| ("help,h", "Show this help message and exit.\n") | ||
| ; | ||
| po::options_description experimentalProofOfConcept("Experimental / Proof of Concept"); | ||
| experimentalProofOfConcept.add_options() | ||
| ("shh", "Enable Whisper.\n") | ||
| ; | ||
| po::options_description allowedOptions("Allowed options"); | ||
| allowedOptions.add(clientDefaultMode).add(clientTransacting).add(clientMining).add(clientNetworking).add(importExportMode).add(generalOptions); | ||
| po::variables_map vm; | ||
| po::store(po::parse_command_line(argc, argv, allowedOptions), vm); | ||
| po::notify(vm); | ||
| for (int i = 1; i < argc; ++i) | ||
| { | ||
| string arg = argv[i]; | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some lines are indented with spaces, please change to tabs everywhere