We can use cl::ResetCommandLineParser() to support different types of
command-lines, as long as we're careful about option lifetimes.
(I tried using subcommands, but the error messages were bad)
I found a mostly-reasonable pattern to isolate the fiddly parts.
Added -scope and -limit flags to the find command to demonstrate.
(Note that scope support seems to be broken in dex?)
Fixed symbol lookup to parse symbol IDs.
Caveats:
- with command help (e.g. find -help), you also get some spam about required arguments. This is a bug in llvm::cl, which prints these to errs() rather than the designated stream.
Maybe use a named struct?
C++ is powerful, but looks obscure at times...