Skip to content

cell-cli target, updated vcpkg, installed CLI11#79

Draft
yannik131 wants to merge 22 commits into
developmentfrom
enhancement/77-cli
Draft

cell-cli target, updated vcpkg, installed CLI11#79
yannik131 wants to merge 22 commits into
developmentfrom
enhancement/77-cli

Conversation

@yannik131
Copy link
Copy Markdown
Owner

Closes #77

Copilot AI review requested due to automatic review settings May 11, 2026 12:05
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a new cell-cli executable intended to run the cell simulation from the command line (Issue #77), wiring in CLI11 via vcpkg/CMake and introducing a SimulationRunner abstraction in libcell.

Changes:

  • Added CLI11 dependency (vcpkg + top-level find_package) and a new cell-cli CMake target.
  • Introduced cell::SimulationRunner API and a CLI frontend that parses --config/--out/--duration.
  • Adjusted cell-gui link visibility to PRIVATE.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
vcpkg.json Adds cli11 dependency for the new CLI app.
src/lib/cell/SimulationRunner.hpp Declares a runner API for config/out/duration-driven simulation runs.
src/lib/cell/SimulationRunner.cpp Adds (currently empty) runner method definitions.
src/apps/cell-gui/CMakeLists.txt Makes cell-gui link to libcellgui as PRIVATE.
src/apps/cell-cli/Main.cpp Implements argument parsing and invokes SimulationRunner.
src/apps/cell-cli/CMakeLists.txt Adds the cell-cli executable target and links against libcell + CLI11.
CMakeLists.txt Finds CLI11 and adds the cell-cli subdirectory to the build.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +1 to +16
#include "SimulationRunner.hpp"

void cell::SimulationRunner::useConfigFile(const fs::path& configFile)
{
}

void cell::SimulationRunner::setOutFile(const fs::path& outFile)
{
}

void cell::SimulationRunner::setSimulationTime(const std::chrono::duration<double>& simulationTime)
{
}

void cell::SimulationRunner::runSimulation()
{
Comment on lines +12 to +18
class SimulationRunner
{
public:
void useConfigFile(const fs::path& configFile);
void setOutFile(const fs::path& outFile);
void setSimulationTime(const std::chrono::duration<double>& simulationTime);
void runSimulation();
Comment on lines +38 to +41
app.add_option("--config", configFile, "Config file")->required()->check(CLI::ExistingFile);
app.add_option("--out", outFile, "Output file (type counts)")->required();
app.add_option("--duration", duration, "Target simulation time in seconds")->required()->check(positiveDouble);

Comment on lines +19 to +36
CLI::Validator positiveDouble{[](const std::string& value) -> std::string
{
try
{
std::size_t pos = 0;
const double result = std::stod(value, &pos);
if (pos != value.size())
throw std::exception{};
else if (result <= 0.0)
return "must be > 0";
return {};
}
catch (...)
{
return "not a valid floating-point number";
}
},
"POSITIVE_DOUBLE"};
Comment on lines +11 to +14
int main(int argc, char** argv)
{
CLI::App app{"Command line interface for the cell simulation"};

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Run simulation from command line

2 participants