aboutsummaryrefslogtreecommitdiffstats
path: root/CommandLineInterface.cpp
diff options
context:
space:
mode:
authorLu Guanqun <guanqun.lu@gmail.com>2015-01-27 00:26:13 +0800
committerLu Guanqun <guanqun.lu@gmail.com>2015-01-27 23:51:33 +0800
commit3e8876d57e2004e41a3c56edf5d3fb1e4db48b19 (patch)
tree869debbe721001fe7526128589641a3e3fbc5d25 /CommandLineInterface.cpp
parent78d6e82f37efcc877a0e01d5f63a3e4d33ab0467 (diff)
downloaddexon-solidity-3e8876d57e2004e41a3c56edf5d3fb1e4db48b19.tar
dexon-solidity-3e8876d57e2004e41a3c56edf5d3fb1e4db48b19.tar.gz
dexon-solidity-3e8876d57e2004e41a3c56edf5d3fb1e4db48b19.tar.bz2
dexon-solidity-3e8876d57e2004e41a3c56edf5d3fb1e4db48b19.tar.lz
dexon-solidity-3e8876d57e2004e41a3c56edf5d3fb1e4db48b19.tar.xz
dexon-solidity-3e8876d57e2004e41a3c56edf5d3fb1e4db48b19.tar.zst
dexon-solidity-3e8876d57e2004e41a3c56edf5d3fb1e4db48b19.zip
simplify solc's option output
The original one is too verbose.
Diffstat (limited to 'CommandLineInterface.cpp')
-rw-r--r--CommandLineInterface.cpp41
1 files changed, 18 insertions, 23 deletions
diff --git a/CommandLineInterface.cpp b/CommandLineInterface.cpp
index 3888f231..87edb24b 100644
--- a/CommandLineInterface.cpp
+++ b/CommandLineInterface.cpp
@@ -205,10 +205,6 @@ void CommandLineInterface::handleMeta(DocumentationType _type, string const& _co
bool CommandLineInterface::parseArguments(int argc, char** argv)
{
-#define OUTPUT_TYPE_STR "Legal values:\n" \
- "\tstdout: Print it to standard output\n" \
- "\tfile: Print it to a file with same name\n" \
- "\tboth: Print both to a file and the stdout\n"
// Declare the supported options.
po::options_description desc("Allowed options");
desc.add_options()
@@ -216,25 +212,24 @@ bool CommandLineInterface::parseArguments(int argc, char** argv)
("version", "Show version and exit")
("optimize", po::value<bool>()->default_value(false), "Optimize bytecode for size")
("input-file", po::value<vector<string>>(), "input file")
- (g_argAstStr.c_str(), po::value<OutputType>(),
- "Request to output the AST of the contract. " OUTPUT_TYPE_STR)
- (g_argAstJson.c_str(), po::value<OutputType>(),
- "Request to output the AST of the contract in JSON format. " OUTPUT_TYPE_STR)
- (g_argAsmStr.c_str(), po::value<OutputType>(),
- "Request to output the EVM assembly of the contract. " OUTPUT_TYPE_STR)
- (g_argOpcodesStr.c_str(), po::value<OutputType>(),
- "Request to output the Opcodes of the contract. " OUTPUT_TYPE_STR)
- (g_argBinaryStr.c_str(), po::value<OutputType>(),
- "Request to output the contract in binary (hexadecimal). " OUTPUT_TYPE_STR)
- (g_argAbiStr.c_str(), po::value<OutputType>(),
- "Request to output the contract's JSON ABI interface. " OUTPUT_TYPE_STR)
- (g_argSolAbiStr.c_str(), po::value<OutputType>(),
- "Request to output the contract's Solidity ABI interface. " OUTPUT_TYPE_STR)
- (g_argNatspecUserStr.c_str(), po::value<OutputType>(),
- "Request to output the contract's Natspec user documentation. " OUTPUT_TYPE_STR)
- (g_argNatspecDevStr.c_str(), po::value<OutputType>(),
- "Request to output the contract's Natspec developer documentation. " OUTPUT_TYPE_STR);
-#undef OUTPUT_TYPE_STR
+ (g_argAstStr.c_str(), po::value<OutputType>()->value_name("stdout|file|both"),
+ "Request to output the AST of the contract.")
+ (g_argAstJson.c_str(), po::value<OutputType>()->value_name("stdout|file|both"),
+ "Request to output the AST of the contract in JSON format.")
+ (g_argAsmStr.c_str(), po::value<OutputType>()->value_name("stdout|file|both"),
+ "Request to output the EVM assembly of the contract.")
+ (g_argOpcodesStr.c_str(), po::value<OutputType>()->value_name("stdout|file|both"),
+ "Request to output the Opcodes of the contract.")
+ (g_argBinaryStr.c_str(), po::value<OutputType>()->value_name("stdout|file|both"),
+ "Request to output the contract in binary (hexadecimal).")
+ (g_argAbiStr.c_str(), po::value<OutputType>()->value_name("stdout|file|both"),
+ "Request to output the contract's JSON ABI interface.")
+ (g_argSolAbiStr.c_str(), po::value<OutputType>()->value_name("stdout|file|both"),
+ "Request to output the contract's Solidity ABI interface.")
+ (g_argNatspecUserStr.c_str(), po::value<OutputType>()->value_name("stdout|file|both"),
+ "Request to output the contract's Natspec user documentation.")
+ (g_argNatspecDevStr.c_str(), po::value<OutputType>()->value_name("stdout|file|both"),
+ "Request to output the contract's Natspec developer documentation.");
// All positional options should be interpreted as input files
po::positional_options_description p;