mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-11 16:45:25 +08:00
Add quotes to options in cmdline printed by ocloc
When ocloc prints the command it was called with, enclose the -options and -internal_options with quotes. This allows easier copy-paste of the cmdline. Related-To: NEO-6002 Signed-off-by: Dominik Dabek <dominik.dabek@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
f4c151cce5
commit
b6ec17843d
@@ -64,8 +64,17 @@ Examples:
|
||||
extern "C" {
|
||||
void printOclocCmdLine(unsigned int numArgs, const char *argv[], std::unique_ptr<OclocArgHelper> &helper) {
|
||||
printf("Command was:");
|
||||
for (auto i = 0u; i < numArgs; ++i)
|
||||
printf(" %s", argv[i]);
|
||||
bool useQuotes = false;
|
||||
for (auto i = 0u; i < numArgs; ++i) {
|
||||
const char *currArg = argv[i];
|
||||
if (useQuotes) {
|
||||
printf(" \"%s\"", currArg);
|
||||
useQuotes = false;
|
||||
} else {
|
||||
printf(" %s", currArg);
|
||||
useQuotes = helper->areQuotesRequired(currArg);
|
||||
}
|
||||
}
|
||||
printf("\n");
|
||||
}
|
||||
|
||||
|
||||
@@ -346,6 +346,10 @@ unsigned int OclocArgHelper::returnIGFXforGen(const std::string &device) {
|
||||
return it->second;
|
||||
}
|
||||
|
||||
bool OclocArgHelper::areQuotesRequired(const std::string_view &argName) {
|
||||
return argName == "-options" || argName == "-internal_options";
|
||||
}
|
||||
|
||||
PRODUCT_CONFIG OclocArgHelper::findConfigMatch(const std::string &device, bool firstAppearance) {
|
||||
auto numeration = getMajorMinorRevision(device);
|
||||
if (numeration.empty()) {
|
||||
|
||||
@@ -147,4 +147,5 @@ class OclocArgHelper {
|
||||
std::string returnProductNameForDevice(unsigned short deviceId);
|
||||
bool isGen(const std::string &device);
|
||||
unsigned int returnIGFXforGen(const std::string &device);
|
||||
bool areQuotesRequired(const std::string_view &argName);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user