How to check if cl option was supplied

I’m using llvm::cl::opt<...> for defining a possible command line option, and parsing the command line via llvm::cl::ParseCommandLineOptions(...).
When using this, is there anyway (method, callback, etc…) to understand if a specific command line option was supplied in the command line?

int llvm::cl::Option::getNumOccurrences() const

https://llvm.org/doxygen/classllvm_1_1cl_1_1Option.html#a2dc75fafb68e7669e776e19da7857cdf

1 Like