Page MenuHomeWildfire Games

Add a -help option
Needs RevisionPublic

Authored by linkmauve on Nov 19 2019, 10:03 PM.



The help.h file is generated by premake in the source/ directory, but shouldn’t get committed there.

Test Plan

Run pyrogenesis -help, pyrogenesis --help and check that they print the help.
Run pyrogenesis and check that it doesn’t.

Diff Detail

Lint Skipped
Unit Tests Skipped

Event Timeline

linkmauve created this revision.Nov 19 2019, 10:03 PM

Build failure - The Moirai have given mortals hearts that can endure.

Link to build:

Build failure - The Moirai have given mortals hearts that can endure.

Link to build:

linkmauve updated this revision to Diff 10359.Nov 19 2019, 10:10 PM

Added myself to the credits, and removed the .gitignore change as it doesn’t seem to exist on svn…

elexis added a subscriber: elexis.Nov 20 2019, 11:52 AM

Writing C++ code in premake sounds problematic, why not load the file in C++ directly? It seems like it'd be there even in the released version. On the other hand also seems unexpected that C++ code depends on a readme file?

Notice that we have a copy of this readme fle in Gamesetup.cpp L1196 already, it was proposed to remove the duplication before.

Perhaps one could have a Readme.cpp with the string and perhaps that could be written to the readme.txt file on demand (whenever soeone updates the file) and shown when the --help command is ran?

Then again that sounds like homecrafted version for a problem that has been solved in more general ways already.

Wouldn't a Manpage be more conventional? Don't linux distributions provide them already?

Then one only needs to type man 0ad and it should show up, without changing any code.

JoshuaJB requested changes to this revision.Dec 1 2019, 11:53 PM
JoshuaJB added a subscriber: JoshuaJB.

I think this is okay. While a build-time copy isn't perfect, having a binaries' help text rely on an external file seems equivalently undesirable. A help text should always work in my opinion.

I just request that you also try to have Gamesetup.cpp use this API. I'd say it's up to you on if you want to swap things around such that the cpp file is the master copy which is copied to the system dir at build-time. Maybe not since text blocks in cpp files are harder to edit?

This revision now requires changes to proceed.Dec 1 2019, 11:53 PM
Stan added a subscriber: Stan.Dec 2 2019, 7:47 AM

Just for the record, only debian seems to provide a man command.