Page MenuHomeWildfire Games

Add a -help option
Needs RevisionPublic

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

Details

Reviewers
JoshuaJB
Summary

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
Lint Skipped
Unit
Unit Tests Skipped

Event Timeline

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

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

Link to build: https://jenkins.wildfiregames.com/job/docker-differential/1121/display/redirect

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

Link to build: https://jenkins.wildfiregames.com/job/vs2015-differential/605/display/redirect

linkmauve updated this revision to Diff 10359.Tue, Nov 19, 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.Wed, Nov 20, 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?

https://manpages.debian.org/stretch/0ad/0ad.6.en.html

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

JoshuaJB requested changes to this revision.Sun, Dec 1, 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.Sun, Dec 1, 11:53 PM
Stan added a subscriber: Stan.Mon, Dec 2, 7:47 AM

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