From 97ca2423a4686f7f9e85a33a88556dae4aad1bab Mon Sep 17 00:00:00 2001 From: Maximilien Siavelis <m@siav.pw> Date: 周一, 06 5月 2019 21:47:20 +0800 Subject: [PATCH] Merge pull request #21 from matteovaralta91/master --- src/tools/license-generator/license-generator.cpp | 43 ++++++++++++++++++++++++------------------- 1 files changed, 24 insertions(+), 19 deletions(-) diff --git a/src/tools/license-generator/license-generator.cpp b/src/tools/license-generator/license-generator.cpp index 0eae1f5..bbf8b0f 100644 --- a/src/tools/license-generator/license-generator.cpp +++ b/src/tools/license-generator/license-generator.cpp @@ -40,31 +40,36 @@ po::options_description LicenseGenerator::configureProgramOptions() { po::options_description common("General options"); - common.add_options()("help,h", "print help message and exit.") // - ("verbose,v", "print more information.") // - ("output,o", po::value<string>(), "Output file name. If not specified the " - "license will be printed in standard output"); // + common.add_options() + ("help,h", "print help message and exit.") + ("verbose,v", "print more information.") + ("output,o", po::value<string>(), "Output file name. If not specified the " + "license will be printed in standard output") + ; po::options_description licenseGeneration("License Generation"); - licenseGeneration.add_options()("private_key,p", po::value<string>(), + licenseGeneration.add_options() + ("private_key,p", po::value<string>(), "Specify an alternate file for the primary key to be used. " - "If not specified the internal primary key will be used.") // - ("begin_date,b", po::value<string>(), + "If not specified the internal primary key will be used.") + ("begin_date,b", po::value<string>(), "Specify the start of the validity for this license. " - " Format YYYYMMDD. If not specified defaults to today") // - ("expire_date,e", po::value<string>(), + " Format YYYYMMDD. If not specified defaults to today") + ("expire_date,e", po::value<string>(), "Specify the expire date for this license. " - " Format YYYYMMDD. If not specified the license won't expire") // - ("client_signature,s", po::value<string>(), + " Format YYYYMMDD. If not specified the license won't expire") + ("client_signature,s", po::value<string>(), "The signature of the pc that requires the license. " "It should be in the format XXXX-XXXX-XXXX-XXXX." " If not specified the license " - "won't be linked to a specific pc.") // - ("start_version,t", po::value<unsigned int>()->default_value(0 - /*FullLicenseInfo.UNUSED_SOFTWARE_VERSION*/, "All Versions"), - "Specify the first version of the software this license apply to.") // - ("end_version,n", po::value<unsigned int>()->default_value(0 - /*FullLicenseInfo.UNUSED_SOFTWARE_VERSION*/, "All Versions"), - "Specify the last version of the software this license apply to."); // + "won't be linked to a specific pc.") + ("start_version,t", po::value<unsigned int>()->default_value(0 + /*FullLicenseInfo.UNUSED_SOFTWARE_VERSION*/, "All Versions"), + "Specify the first version of the software this license apply to.") + ("end_version,n", po::value<unsigned int>()->default_value(0 + /*FullLicenseInfo.UNUSED_SOFTWARE_VERSION*/, "All Versions"), + "Specify the last version of the software this license apply to.") + ("extra_data,x", po::value<string>(), "Specify extra data to be included into the license") + ; po::options_description visibleOptions; visibleOptions.add(common).add(licenseGeneration); return visibleOptions; @@ -173,7 +178,7 @@ if (vm.count("output")) { const std::string fname = vm["output"].as<string>(); - fstream ofstream(fname, std::ios::out | std::ios::trunc); + fstream ofstream(fname, std::ios::out | std::ios::app); if (!ofstream.is_open()) { cerr << "can't open file [" << fname << "] for output." << endl << " error: " << strerror( errno); -- Gitblit v1.9.1