Add abstract virtual method setDefault() to class Option() and implement it in its inheritors in order to be able to set all the options to its default values in user's code without actually knowing all these options. For instance:
for (auto SC : llvm::cl::getRegisteredSubcommands()) { for (auto &OM : SC->OptionsMap) { llvm::cl::Option *O = OM.second; // added functionality: O->setDefault(); } }