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

Add: '-X' option to ignore global folders in the search path #9341

Merged
merged 1 commit into from Jun 10, 2021

Conversation

TrueBrain
Copy link
Member

Motivation / Problem

Imagine this: you have 400 NewGRFs and 4 basesets in your ~/.local/share/openttd folder. You want to run some automated tests for OpenTTD that has 10 NewGRFs and 1 baseset. Owh no, it still looks all those other NewGRFs too!

But wait, we have -c you say! Yeah .. that doesn't work for the global folders.

Okay okay .. so I just rename that ~/.local/share/openttd folder every time .. well .. I am crazy, but not that crazy.

Description

So I present you with an alternative: -X. This setting completely ignores global folders and only use the ones you gave with -c. Nice.

This is extreme useful for automated testing. Without this, OpenTTD
will always look in your personal-dir (like ~/.local/share/openttd
or %USER%\Documents\OpenTTD). For most users this is exactly what
we want, that there is a shared place for all their files.

However, for automated testing this is rather annoying, as your
local development files influence the automated test. As such,
'-X' counters this, and only gives the local folders. This is
especially useful in combination with '-x' and '-c'.

Limitations

Checklist for review

Some things are not automated, and forgotten often. This list is a reminder for the reviewers.

  • The bug fix is important enough to be backported? (label: 'backport requested')
  • This PR affects the save game format? (label 'savegame upgrade')
  • This PR affects the GS/AI API? (label 'needs review: Script API')
    • ai_changelog.hpp, gs_changelog.hpp need updating.
    • The compatibility wrappers (compat_*.nut) need updating.
  • This PR affects the NewGRF API? (label 'needs review: NewGRF')

michicc
michicc previously approved these changes Jun 10, 2021
src/openttd.cpp Outdated Show resolved Hide resolved
@rubidium42
Copy link
Contributor

Shouldn't docs/openttd.6 (the man page) be updated with this new parameter?

This is extreme useful for automated testing. Without this, OpenTTD
will always look in your personal-dir (like ~/.local/share/openttd
or %USER%\Documents\OpenTTD). For most users this is exactly what
we want, that there is a shared place for all their files.

However, for automated testing this is rather annoying, as your
local development files influence the automated test. As such,
'-X' counters this, and only gives the local folders. This is
especially useful in combination with '-x' and '-c'.
@TrueBrain
Copy link
Member Author

Shouldn't docs/openttd.6 (the man page) be updated with this new parameter?

lol, we have that file? Is that still in use ...

Either way, that file hasn't been updated in a while, and I have no clue how I would be to update it. Even worse, it uses different ways to describe the same settings than openttd.cpp .. so I think it should just be overhauled completely. But 0 clue how to do that, and I really do not feel like spending time on it :P (sorry, but at least I am honest :D)

@TrueBrain TrueBrain merged commit ed3946e into OpenTTD:master Jun 10, 2021
@TrueBrain TrueBrain deleted the easier-savegame-testing branch June 10, 2021 21:13
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.

None yet

3 participants