IMP logo
IMP Reference Guide  develop.7482b7c7af, 2026/12/05
The Integrative Modeling Platform
flags.cpp

Show simple usage of the command line flags support in IMP in a C++ executable. Run with "--help" to see all available flags.

/** \example flags.cpp
Show simple usage of the command line flags support in IMP in a
C++ executable. Run with "--help" to see all available flags.
*/
#include <IMP/flags.h>
#include <IMP/Flag.h>
int main(int argc, char *argv[]) {
IMP::Flag<std::string> hello("hello", "How to say hello.",
"Hello world");
IMP::setup_from_argv(argc, argv, "Example on C++ use of flags.");
std::cout << hello << std::endl;
return 0;
}
Utility classes to add command line flags.
Support for shared command line flags.
void setup_from_argv(int argc, char **argv, std::string description)
Parse the command line flags and return the positional arguments.