-
Notifications
You must be signed in to change notification settings - Fork 74
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
JavaFX: parse command line arguments #2222
base: master
Are you sure you want to change the base?
Conversation
I think it would be cool if it becomes possible to use the same Phoenicis application both from the terminal and as an UI application. I think essentially we will need to add a wrapper around our current JavaFX UI application that decides whether the UI should be started or the application should be run in terminal mode. |
I have no idea how this could be implemented. |
When trying to install an app, you just get a white window. Not really sure why this behaves differently than |
Essentially I am suggesting to change public class JavaFXApplication extends Application {
public static void main(String[] args) {
if (args.length == 0 || args[0] == "gui") {
try {
Application.launch(args);
} catch (Exception e) {
e.printStackTrace();
}
} else if (args[0] == "cli") {
// execute phoenicis in CLI mode
}
}
} |
Wouldn't that imply that |
What do you mean by a |
This is what I meant. Do we want this? |
I do not know how others think about this, but in my opinion it is not a huge problem adding the JavaFX dependencies to the applications. I mean Java itself is normally bundled with a lot of "unnecessary" libraries (including Swing). I don't think that it is a big issue to add another library if it benefits us. In the scope of this PR I would say that adding JavaFX as a dependency to phoenicis-cli makes it much easier to maintain both applications. In addition it allows us distributing both the cli and the JavaFX client as a single application, which is also a huge benefit. |
This is definitely something where I would like @qparis opinion. |
The
CLIController
is more or less copy+paste fromphoenicis-cli
.Running an app works, installation not.
We need a way to integrate this in the design of the JavaFX application. One possibility could be that
MainController
offers a methodinstallApp
. @madoar any suggestions (feel free to edit in the PR directly)?