From 59ad75763d2c9da58e2f32bb6285baeeab7e3825 Mon Sep 17 00:00:00 2001 From: Lu Guanqun Date: Tue, 27 Jan 2015 00:26:13 +0800 Subject: [PATCH] simplify solc's option output The original one is too verbose. --- solc/CommandLineInterface.cpp | 41 +++++++++++++++-------------------- 1 file changed, 18 insertions(+), 23 deletions(-) diff --git a/solc/CommandLineInterface.cpp b/solc/CommandLineInterface.cpp index 3888f2314..87edb24b0 100644 --- a/solc/CommandLineInterface.cpp +++ b/solc/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()->default_value(false), "Optimize bytecode for size") ("input-file", po::value>(), "input file") - (g_argAstStr.c_str(), po::value(), - "Request to output the AST of the contract. " OUTPUT_TYPE_STR) - (g_argAstJson.c_str(), po::value(), - "Request to output the AST of the contract in JSON format. " OUTPUT_TYPE_STR) - (g_argAsmStr.c_str(), po::value(), - "Request to output the EVM assembly of the contract. " OUTPUT_TYPE_STR) - (g_argOpcodesStr.c_str(), po::value(), - "Request to output the Opcodes of the contract. " OUTPUT_TYPE_STR) - (g_argBinaryStr.c_str(), po::value(), - "Request to output the contract in binary (hexadecimal). " OUTPUT_TYPE_STR) - (g_argAbiStr.c_str(), po::value(), - "Request to output the contract's JSON ABI interface. " OUTPUT_TYPE_STR) - (g_argSolAbiStr.c_str(), po::value(), - "Request to output the contract's Solidity ABI interface. " OUTPUT_TYPE_STR) - (g_argNatspecUserStr.c_str(), po::value(), - "Request to output the contract's Natspec user documentation. " OUTPUT_TYPE_STR) - (g_argNatspecDevStr.c_str(), po::value(), - "Request to output the contract's Natspec developer documentation. " OUTPUT_TYPE_STR); -#undef OUTPUT_TYPE_STR + (g_argAstStr.c_str(), po::value()->value_name("stdout|file|both"), + "Request to output the AST of the contract.") + (g_argAstJson.c_str(), po::value()->value_name("stdout|file|both"), + "Request to output the AST of the contract in JSON format.") + (g_argAsmStr.c_str(), po::value()->value_name("stdout|file|both"), + "Request to output the EVM assembly of the contract.") + (g_argOpcodesStr.c_str(), po::value()->value_name("stdout|file|both"), + "Request to output the Opcodes of the contract.") + (g_argBinaryStr.c_str(), po::value()->value_name("stdout|file|both"), + "Request to output the contract in binary (hexadecimal).") + (g_argAbiStr.c_str(), po::value()->value_name("stdout|file|both"), + "Request to output the contract's JSON ABI interface.") + (g_argSolAbiStr.c_str(), po::value()->value_name("stdout|file|both"), + "Request to output the contract's Solidity ABI interface.") + (g_argNatspecUserStr.c_str(), po::value()->value_name("stdout|file|both"), + "Request to output the contract's Natspec user documentation.") + (g_argNatspecDevStr.c_str(), po::value()->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;