Allow any cl::opt to use the method getPosition() to retrieve the option's
authorReid Spencer <rspencer@reidspencer.com>
Fri, 13 Aug 2004 19:47:30 +0000 (19:47 +0000)
committerReid Spencer <rspencer@reidspencer.com>
Fri, 13 Aug 2004 19:47:30 +0000 (19:47 +0000)
commit1e13fd23d34e53b63cb08c0fe54f0857757ec200
tree02f4b43a852b5f8f58a3fdca67aa7e712fc426fa
parent1c284ac5ec72c86b9ed787b3f4e1a6978c919370
Allow any cl::opt to use the method getPosition() to retrieve the option's
absolute position on the command line. Similarly allow any cl::list to
use the method getPosition(n) to retrieve the absolute position of the nth
option in the list. This provides support for two things: (a) options like
-l that are actually positional and their order of occurrence matters when
they are intermixed with positional arguments like "a.o"; and (b) options
like -x LANG which affect only the positional arguments that come after
the option. In both cases, knowing the absolute position of a given option
helps.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15725 91177308-0d34-0410-b5e6-96231b3b80d8
include/Support/CommandLine.h
include/llvm/Support/CommandLine.h
lib/Support/CommandLine.cpp