Skip to content

IVY-1321 Make Main.run() public #70

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

Closed
wants to merge 0 commits into from
Closed

Conversation

twogee
Copy link
Contributor

@twogee twogee commented Mar 20, 2018

Inspired by #69

@twogee
Copy link
Contributor Author

twogee commented Mar 20, 2018

This addresses IVY-1321 and IVY-1578

@supertick
Copy link

I agree @twogee now that I've seen your change, your solution would be better.
I felt too, adding a new command line option was not the best, but also felt strongly, with minimal work the standalone interface could be supported. I'm glad your change supports the interface without the additional option.

Now perhaps these https://www.google.com/search?q=ivy+programmatic+stackoverflow
can be answered simply with

try {
    CommandLineParser parser = getParser();
    // parse the command line arguments	  
    CommandLine line = parser.parse(args);	         
    ResolveReport  report = Main.run(line, false);
    // iterate through the report
} catch (Exception e) {
    // do something to handle error
}

Thanks.

@twogee
Copy link
Contributor Author

twogee commented Mar 20, 2018

Actually, you should be able to do

try {
    ResolveReport  report = Main.run(args, false);
    // iterate through the report
} catch (Exception e) {
    // do something to handle error
}

But, I was hasty and the tests still fail. I'll try to rectify that later today.

@twogee twogee changed the title Make Main.run() usable programmatically IVY-1321 Make Main.run() usable programmatically Mar 20, 2018
@twogee twogee changed the title IVY-1321 Make Main.run() usable programmatically IVY-1321 Make Main.run() public Mar 20, 2018
@twogee
Copy link
Contributor Author

twogee commented Mar 20, 2018

I'm a bit surprised that StackOverflow does not refer to Apache Confluence

@twogee twogee force-pushed the ivy-1321 branch 2 times, most recently from a644bc1 to 3f77855 Compare March 20, 2018 16:48
@twogee
Copy link
Contributor Author

twogee commented Mar 20, 2018

@supertick if you're fine with this PR, please close #69. I will merge this one later.

@supertick
Copy link

I would make a default overload which took only a String[] arg to model exactly the Main.main input, but all the rest is perfect, including the better isCli boolean vs silly cli option

ResolveReport report = Main.run(new String[]{ .... exact standalone api ... })

I would leave the Exception throws signature in the overloaded run method...

Thanks for your consideration, work, and mention ;) !
Cheers !

@twogee
Copy link
Contributor Author

twogee commented Mar 21, 2018

Thanks for bearing with me 😉please see the revised commit.

@supertick
Copy link

Looks great !
(had to look up what REPL is - thanks for the heads up)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants