@@ -969,7 +969,8 @@ CmdLineParser::Result CmdLineParser::parseFromArgs(int argc, const char* const a
969969 }
970970
971971 // Special Cppcheck Premium options
972- else if (std::strncmp (argv[i], " --premium=" , 10 ) == 0 && isCppcheckPremium ()) {
972+ else if ((std::strncmp (argv[i], " --premium=" , 10 ) == 0 || std::strncmp (argv[i], " --premium-" , 10 ) == 0 ) && isCppcheckPremium ()) {
973+ // valid options --premium=..
973974 const std::set<std::string> valid{
974975 " autosar" ,
975976 " cert-c-2016" ,
@@ -983,6 +984,11 @@ CmdLineParser::Result CmdLineParser::parseFromArgs(int argc, const char* const a
983984 " misra-cpp-2023" ,
984985 " bughunting" ,
985986 " safety" };
987+ // valid options --premium-..=
988+ const std::set<std::string> valid2{
989+ " cert-c-int-precision" ,
990+ " license-file"
991+ };
986992
987993 if (std::strcmp (argv[i], " --premium=safety-off" ) == 0 ) {
988994 mSettings .safety = false ;
@@ -993,8 +999,9 @@ CmdLineParser::Result CmdLineParser::parseFromArgs(int argc, const char* const a
993999 if (!mSettings .premiumArgs .empty ())
9941000 mSettings .premiumArgs += " " ;
9951001 const std::string p (argv[i] + 10 );
996- if (!valid.count (p) && !startsWith (p, " cert-c-int-precision=" )) {
997- mLogger .printError (" invalid --premium option '" + p + " '." );
1002+ const std::string p2 (p.find (' =' ) != std::string::npos ? p.substr (0 , p.find (' =' )) : " " );
1003+ if (!valid.count (p) && !valid2.count (p2)) {
1004+ mLogger .printError (" invalid --premium option '" + (p2.empty () ? p : p2) + " '." );
9981005 return Result::Fail;
9991006 }
10001007 mSettings .premiumArgs += " --" + p;
0 commit comments