| | |
| | | } |
| | | |
| | | vector<FullLicenseInfo> LicenseGenerator::parseLicenseInfo( |
| | | po::variables_map vm) { |
| | | const po::variables_map& vm) { |
| | | string begin_date = FullLicenseInfo::UNUSED_TIME; |
| | | string end_date = FullLicenseInfo::UNUSED_TIME; |
| | | if (vm.count("expire_date")) { |
| | |
| | | string client_signature = ""; |
| | | if (vm.count("client_signature")) { |
| | | client_signature = vm["client_signature"].as<string>(); |
| | | //fixme match + and / |
| | | /*regex e("(A-Za-z0-9){4}-(A-Za-z0-9){4}-(A-Za-z0-9){4}-(A-Za-z0-9){4}"); |
| | | if (!regex_match(client_signature, e)) { |
| | | cerr << endl << "Client signature not recognized: " |
| | | << client_signature |
| | | << " Please enter a valid signature in format XXXX-XXXX-XXXX-XXXX" |
| | | << endl; |
| | | exit(2); |
| | | }*/ |
| | | regex e("[A-Za-z0-9\\+/]{4}-[A-Za-z0-9\\+/]{4}-[A-Za-z0-9\\+/]{4}-[A-Za-z0-9\\+/]{4}"); |
| | | if (!regex_match(client_signature, e)) { |
| | | cerr << endl << "Client signature not recognized: " |
| | | << client_signature |
| | | << " Please enter a valid signature in format XXXX-XXXX-XXXX-XXXX" |
| | | << endl; |
| | | exit(2); |
| | | } |
| | | } |
| | | string extra_data = ""; |
| | | if (vm.count("extra_data")) { |
| | |
| | | int LicenseGenerator::generateLicense(int argc, const char **argv) { |
| | | |
| | | po::options_description visibleOptions = configureProgramOptions(); |
| | | //positional options must be addedd to standard options |
| | | //positional options must be added to standard options |
| | | po::options_description allOptions; |
| | | allOptions.add(visibleOptions).add_options()("product", |
| | | po::value<vector<string>>(), "product names"); |