From 7488e43d6951402246d83f47bbe1ebce9f05e71e Mon Sep 17 00:00:00 2001 From: Andy Cedilnik Date: Wed, 29 Sep 2004 07:56:25 -0400 Subject: ENH: Add access to last argument parsed --- Source/kwsys/CommandLineArguments.cxx | 6 ++++++ Source/kwsys/CommandLineArguments.hxx.in | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/Source/kwsys/CommandLineArguments.cxx b/Source/kwsys/CommandLineArguments.cxx index 388feb2..a217791 100644 --- a/Source/kwsys/CommandLineArguments.cxx +++ b/Source/kwsys/CommandLineArguments.cxx @@ -486,6 +486,12 @@ const char* CommandLineArguments::GetArgv0() } //---------------------------------------------------------------------------- +unsigned int CommandLineArguments::GetLastArgument() +{ + return this->Internals->LastArgument + 1; +} + +//---------------------------------------------------------------------------- void CommandLineArguments::GenerateHelp() { kwsys_ios::ostringstream str; diff --git a/Source/kwsys/CommandLineArguments.hxx.in b/Source/kwsys/CommandLineArguments.hxx.in index 630de59..a3bfc3f 100644 --- a/Source/kwsys/CommandLineArguments.hxx.in +++ b/Source/kwsys/CommandLineArguments.hxx.in @@ -142,6 +142,12 @@ public: */ const char* GetArgv0(); + /** + * Get index of the last argument parsed. This is the last argument that was + * parsed ok in the original argc/argv list. + */ + unsigned int GetLastArgument(); + protected: void GenerateHelp(); -- cgit v0.12