The help.h file is generated by premake in the source/ directory, but shouldn’t get committed there.
Details
- Reviewers
JoshuaJB
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
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
Added myself to the credits, and removed the .gitignore change as it doesn’t seem to exist on svn…
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.
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?
I'm not sure what you mean by this. Every distro I've ever used provides a man command. I think for some people, it's a matter of preference. Some would rather use man and some find "--help" perfectly adequate. help2man could be used to generate a man page during the run of update-workspaces.sh. Another option would be to not worry about a man page and only decide to add one if there's actually requests by users in the future.
But wouldn't it be easier to extract strings for translation if the strings were in the code itself? Since the goal is to have the game fully translated, wouldn't you want the help output translated as well? po4a can translate documents, but I don't think it'd be desirable to use that, or add it, while you already have a translation system in place.
I mean that debian provides or used to provide a man page for 0 A.D. while some other distributions do not :).
Well we already extract strings from txt files (e.g tips) but I'm not sur the localisation is loaded that early. It could be though I suppose.
Well, I guess I'm repeating myself a bit... a man page can be a bitch to maintain. I suggest implementing a parser like C's getopt or https://theboostcpplibraries.com/boost.program_options , and using help2man to generate a man page (which can be at least customized a little with a template).
And if a decision were made, I'd help implement it. This is an example of how I implemented it on rmw https://github.com/theimpossibleastronaut/rmw/blob/master/src/parse_cli_options.c
Though that was with no one else around to discuss it so I'd be open to variadic improvements ;)