Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve option parsing #3098

Merged
merged 1 commit into from
Oct 5, 2018
Merged

Conversation

keithc-ca
Copy link
Contributor

The primary change is to do option pattern matching just once. Instead of:

if ( $argv =~ /^\-\-graphSpecs=/ ) {
    ($graphSpecs) = $argv =~ /^\-\-graphSpecs=(.*)/;
}   

we can use:

if ( $argv =~ /^--graphSpecs=(.*)/ ) { 
    $graphSpecs = $1;
} 

which ensures a proper option match and captures the option value at the same time.
Also, - doesn't need to be escaped in this context.

Signed-off-by: Keith W. Campbell <keithc@ca.ibm.com>
Copy link
Contributor

@renfeiw renfeiw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. It's a cleaner and properer way of doing the argument parsing.

@smlambert
Copy link
Contributor

Tested via Grinder (internal due to issues with openj9 Jenkins server today).

@smlambert smlambert merged commit 39cfa48 into eclipse-openj9:master Oct 5, 2018
@keithc-ca keithc-ca deleted the testkitgen branch October 9, 2018 14:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants