Skip to content

Commit

Permalink
Add a hidden --debug-cli param to "Print the result of the CLI assi…
Browse files Browse the repository at this point in the history
…gnments to the console and exit"
  • Loading branch information
jmarrec committed Jul 18, 2023
1 parent 27cb010 commit 7c5f061
Showing 1 changed file with 22 additions and 16 deletions.
38 changes: 22 additions & 16 deletions src/EnergyPlus/CommandLineInterface.cc
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,9 @@ Built on Platform: {}
->required(false)
->check(CLI::ExistingFile);

bool debugCLI = false;
app.add_flag("--debug-cli", debugCLI, "Print the result of the CLI assignments to the console and exit")->group(""); // Empty group to hide it

// opt.example = "energyplus -w weather.epw -r input.idf";
app.footer("energyplus -w weather.epw -r input.idf");

Expand Down Expand Up @@ -264,8 +267,9 @@ Built on Platform: {}
}
}

fmt::print(stderr,
R"debug(
if (debugCLI) {
fmt::print(stderr,
R"debug(
state.dataGlobal->AnnualSimulation = {},
state.dataGlobal->DDOnlySimulation = {},
state.dataStrGlobals->outDirPath = '{}',
Expand All @@ -284,20 +288,22 @@ state.dataGlobal->numThread={},
state.files.inputWeatherFilePath.filePath='{}',
state.dataStrGlobals->inputFilePath='{}',
)debug",
state.dataGlobal->AnnualSimulation,
state.dataGlobal->DDOnlySimulation,
state.dataStrGlobals->outDirPath.generic_string(),
state.dataStrGlobals->inputIddFilePath.generic_string(),

runEPMacro,
prefixOutName,
state.dataGlobal->runReadVars,
state.dataGlobal->outputEpJSONConversion,
state.dataGlobal->outputEpJSONConversionOnly,
suffixType,
state.dataGlobal->numThread,
state.files.inputWeatherFilePath.filePath,
state.dataStrGlobals->inputFilePath);
state.dataGlobal->AnnualSimulation,
state.dataGlobal->DDOnlySimulation,
state.dataStrGlobals->outDirPath.generic_string(),
state.dataStrGlobals->inputIddFilePath.generic_string(),

runEPMacro,
prefixOutName,
state.dataGlobal->runReadVars,
state.dataGlobal->outputEpJSONConversion,
state.dataGlobal->outputEpJSONConversionOnly,
suffixType,
state.dataGlobal->numThread,
state.files.inputWeatherFilePath.filePath,
state.dataStrGlobals->inputFilePath);
exit(0);
}

// Convert all paths to native paths
state.dataStrGlobals->inputFilePath = FileSystem::makeNativePath(state.dataStrGlobals->inputFilePath);
Expand Down

5 comments on commit 7c5f061

@nrel-bot
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

9825_CLI (jmarrec) - Win64-Windows-10-VisualStudio-16: Build Failed

Failures:\n

API Test Summary

  • Failed: 10
  • notrun: 5

integration Test Summary

  • Passed: 2
  • Failed: 773

Build Badge Test Badge

@nrel-bot-3
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

9825_CLI (jmarrec) - x86_64-MacOS-10.17-clang-13.0.0: OK (3430 of 3440 tests passed, 0 test warnings)

Failures:\n

API Test Summary

  • Passed: 14
  • Failed: 1

integration Test Summary

  • Passed: 766
  • Failed: 9

Build Badge Test Badge

@nrel-bot-2b
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

9825_CLI (jmarrec) - x86_64-Linux-Ubuntu-22.04-gcc-11.3: OK (3470 of 3481 tests passed, 0 test warnings)

Failures:\n

API Test Summary

  • Passed: 14
  • Failed: 1

integration Test Summary

  • Passed: 768
  • Failed: 10

Build Badge Test Badge

@nrel-bot-2b
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

9825_CLI (jmarrec) - x86_64-Linux-Ubuntu-22.04-gcc-11.3-UnitTestsCoverage-Debug: OK (1893 of 1894 tests passed, 0 test warnings)

Failures:\n

API Test Summary

  • Passed: 14
  • Failed: 1

Build Badge Test Badge Coverage Badge

@nrel-bot-2
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

9825_CLI (jmarrec) - x86_64-Linux-Ubuntu-22.04-gcc-11.3-IntegrationCoverage-Debug: OK (766 of 776 tests passed, 0 test warnings)

Failures:\n

integration Test Summary

  • Passed: 766
  • Failed: 10

Build Badge Test Badge Coverage Badge

Please sign in to comment.