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

Separate main function from MainCommand #1723

Closed
jan-goral opened this issue Mar 23, 2021 · 0 comments · Fixed by #1724
Closed

Separate main function from MainCommand #1723

jan-goral opened this issue Mar 23, 2021 · 0 comments · Fixed by #1724

Comments

@jan-goral
Copy link
Contributor

jan-goral commented Mar 23, 2021

In an abstract way, the main function is a typical entry point for any jvm application. The CLI is one of the possible options for how the user can interact with the application. Those are two different things and should be separated.

Author the user story for this feature

As a developer, I want to have separated the main function from the picocli MainComand due to the SRP rule.

Describe the solution

the ftl.Main.kt file should contain only the entry point function:

fun main(args: Array<String>) {
    withGlobalExceptionHandling {
        CommandLine(Main()).execute(*args)
    }
}

Everything else, related to picocli command should go to the ftl.cli.MainCommand.kt

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

Successfully merging a pull request may close this issue.

1 participant