BOUT-dev icon indicating copy to clipboard operation
BOUT-dev copied to clipboard

Add `--version` command line argument

Open ZedThree opened this issue 2 years ago • 0 comments

#2595 made me realise we still don't have a --version command line argument. Ideally, this should report both the model version and the library version, something like:

$ ./my_model --version
my_model 1.2.3 (BOUT++ library v5.0.0)

Reporting the library version is trivial, but we'd need some mechanism for getting the library version. We could probably use the same infrastructure to add information to --help. Maybe some optional struct like:

struct MyModelMetadata {
  std::string version = VERSION;
  std::string description = "My BOUT++ model, solves the physics equations and that";
  // Could be used to print help on model options
  std::string options_key = "my_model";
};

This would be passed to BOUTMAIN (or even better, some BoutSimulation class as a template argument).

ZedThree avatar Oct 14 '22 08:10 ZedThree