]> git.cworth.org Git - apitrace/commit
glretrace: Use getopt rather than manual parsing of command-line options
authorCarl Worth <cworth@cworth.org>
Sun, 12 Aug 2012 19:44:50 +0000 (12:44 -0700)
committerJosé Fonseca <jose.r.fonseca@gmail.com>
Wed, 14 Nov 2012 07:21:49 +0000 (07:21 +0000)
commit65788a69cd34e015823ca6532852b4168e291c75
treef0238a745254a653eb05e6f74225edf55a04cbac
parenta7e7b27a13dc40db4ec96bc1bba667644ef0a896
glretrace: Use getopt rather than manual parsing of command-line options

This allows for better consistency with other apitrace command-line
interface. It also provids for several new full-name options where
previously only a single-letter option was available,
(--snapshot-prefix for -s, --verbose for -v, et.).

We use getopt_long_only here to maintain compatibility with the older
style of long options with one dash (-core) as well as providing the
double-dash version )--core).

It would now be quite convenient to regularize the command-line
interface to glretrace in several ways. None of these are performed in
this commit to avoid breaking compatibility with existing scripts,
etc.:

  * Give multi-letter, abbreviated options (--pcpu, etc.) proper
    long-form names (--profile-cpu).

  * Combine related options under a single name (--pcpu and --pgpu
    could be something like --profile=cpu,gpu).

  * Combine options with the same meaning that would never be used
    independently. Snapshot generation and snapshot comparison are
    different modes. Meanwhile, prefix selection and call selection
    should apply identically to either mode. So both modes can use a
    single set of options (--prefix and --calls) rather than having
    separate --snapshot-prefix and --snapshot options.
retrace/retrace_main.cpp