Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Better command line in rlp #4639
@@ Coverage Diff @@ ## develop #4639 +/- ## =========================================== + Coverage 60.9% 61.09% +0.18% =========================================== Files 343 343 Lines 26999 27089 +90 Branches 2765 2779 +14 =========================================== + Hits 16444 16550 +106 + Misses 9603 9569 -34 - Partials 952 970 +18
Ok, the help output looks a little weird now:
Usage rlp <mode> [OPTIONS] Modes: -i [ --indent ] arg <string> Use string as the level indentation (default ' '). --hex-ints Render integers in hex. --string-ints Render integers in the same way as strings. --ascii-strings Render data as C-style strings or hex depending on content being ASCII. --force-string Force all data to be rendered as C-style strings. --force-escape When rendering as C-style strings, force all characters to be escaped. --force-hex Force all data to be rendered as raw hex. -D [ --dapp ] Dapp-building mode; equivalent to --encrypt --64. create <json> Given a simplified JSON string, output the RLP. render [ <file> | -- ] Render the given RLP. Options: list [ <file> | -- ] List the items in the RLP list by hash and size. extract [ <file> | -- ] Extract all items in the RLP list, named by hash. assemble [ <manifest> | <base path> ] <file> ... Given a manifest & files, output the RLP. General options: -e [ --encrypt ] Encrypt the RLP data prior to output. -L [ --lenience ] Try not to bomb out early if possible. -x [ --hex ] Treat input RLP as hex encoded data. --base-16 Treat input RLP as hex encoded data. -k [ --keccak ] Output Keccak-256 hash only. --base-64 Treat input RLP as base-64 encoded data. --64 Treat input RLP as base-64 encoded data. -b [ --bin ] Treat input RLP as raw binary data. --base-256 Treat input RLP as raw binary data. -q [ --quiet ] Don't place additional information on stderr. -h [ --help ] Print this help message and exit. -V [ --version ] Show the version and exit.
We should figure out how to make it better, modes (create, render, list, extract, assemble) should be on the top, after
The options on top I think make sense for the
render mostly, so maybe they should have title "Render Options"
Also please move
-D into General options, because it's a combination of two other general options, I think it fits there better
What if we change it to
The challenge might be in different modes having different number of arguments following them (like
Check out also "positional options". maybe it helps somehow http://www.boost.org/doc/libs/1_58_0/doc/html/program_options/tutorial.html#idp337627504