> I'm not a grep or RegEx expert, however I bet using these tools I
> can't have a full feature command line parsing.
> Looking at how works getopt() there are plenty of options and rules
> to follow.
I'm sure you're right but this may be better than nothing.
Function getOpt(opt As String) As String
// Returns a blank string if option is not in commandline
// Else returns the option including multiple leading + or -
dim r As new RegEx
dim m As RegExMatch
r.SearchPattern = "([+-]*" + opt +"\b)"
m = r.Search(self.CommandLine)
if m is nil Then
Return ""
else
Return m.SubExpressionString(0)
end if
End Function
--
Steve Garman
Using REALbasic 2006r2 Professional on Windows XP Pro
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>