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

--args overrides default arguments instead of appending them #4956

Open
jdrueckert opened this issue Nov 20, 2021 · 5 comments
Open

--args overrides default arguments instead of appending them #4956

jdrueckert opened this issue Nov 20, 2021 · 5 comments
Labels
Size: S Small effort likely only affecting a single area and requiring little to no research Topic: UI/UX Requests, Issues and Changes related to screens, artwork, sound and overall user experience Type: Bug Issues reporting and PRs fixing problems

Comments

@jdrueckert
Copy link
Member

jdrueckert commented Nov 20, 2021

What you were trying to do

Start a headless server and override its default configuration.

./gradlew server --args="--override-default-config=override.cfg"

What actually happened

A headed Terasology game started.

How to reproduce

  1. Run ./gradlew server and notice that it starts a headless server
  2. Stop the headless server
  3. Run ./gradlew server --args="--override-default-config=override.cfg" and notice that it starts headed Terasology (main menu UI)
  4. Stop the game
  5. Run ./gradlew server --args="--override-default-config=override.cfg --headless" and notice that it starts a headless server

Workaround

Add --headless argument

./gradlew server --args="--override-default-config=override.cfg --headless"
@jdrueckert jdrueckert added Type: Bug Issues reporting and PRs fixing problems Topic: UI/UX Requests, Issues and Changes related to screens, artwork, sound and overall user experience Size: S Small effort likely only affecting a single area and requiring little to no research labels Nov 20, 2021
@keturn
Copy link
Member

keturn commented Nov 21, 2021

One potential pitfall to look out for while addressing this:

If you do have --args always append to the gradle task's default args instead of replacing them, you get duplicates.

For example, gradlew game --args=--homedir=server would end up as

Terasology --homedir=. --homedir=server

at which point Terasology's argument processor (picocli) will complain that homedir can't be both . and server.

@DarkWeird
Copy link
Contributor

@jdrueckert
Oh it is my change #4916
But server didn't work before :D

@keturn
Yeah. I already fix it in #4916.
--homedir=. was from kotlin build script.
--homedir=server was from server task

@DarkWeird
Copy link
Contributor

Maybe better provide gradle's parameter there?

@keturn
Copy link
Member

keturn commented Nov 23, 2021

Which gradle parameter?

@DarkWeird
Copy link
Contributor

Which gradle parameter?

create parameter Like -PadditionalArgs=..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Size: S Small effort likely only affecting a single area and requiring little to no research Topic: UI/UX Requests, Issues and Changes related to screens, artwork, sound and overall user experience Type: Bug Issues reporting and PRs fixing problems
Projects
None yet
Development

No branches or pull requests

3 participants