Skip to content

Commit

Permalink
Add compilation date macro
Browse files Browse the repository at this point in the history
  • Loading branch information
Slackadays authored Nov 15, 2021
1 parent 752baa6 commit 6f18617
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
9 changes: 5 additions & 4 deletions source/hajime.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,16 +59,17 @@ int main(int argc, char *argv[]) {
auto flag = [&i, &argv](auto ...fs){return (!strcmp(fs, argv[i]) || ...);}; //compare flags with a parameter pack pattern
if (flag("-h", "--help")) { //-h = --help = help
logObj->out(text.help[0]);
logObj->out(text.help[1] + (string)argv[0] + text.help[2]); //show example of hajime and include its executed file
logObj->out(text.help[3]);
logObj->out(text.help[1]);
logObj->out(text.help[2] + (string)argv[0] + text.help[3]); //show example of hajime and include its executed file
logObj->out(text.help[4]);
logObj->out(text.help[5]);
logObj->out(text.help[6]);
logObj->out(text.help[7]);
logObj->out(text.help[8]);
logObj->out(text.help[9]);
logObj->out(text.help[10], None, 1);
logObj->out(text.help[11]); //note: Linux doesn't put an endline at the end upon exit, but Windows does
logObj->out(text.help[10]);
logObj->out(text.help[11], None, 1);
logObj->out(text.help[12]); //note: Linux doesn't put an endline at the end upon exit, but Windows does
return 0;
}
}
Expand Down
1 change: 1 addition & 0 deletions source/languages.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ using std::string;
void Text::applyLang(string lang) {
if (lang[0] == 'e' && lang[1] == 'n') {
help.push_back("Welcome to Hajime, the ultimate Minecraft server startup script!");
help.push_back("This version of Hajime was compiled on " __DATE__ ".");
help.push_back("\033[1m\033[32mUsage:\033[0m ");
help.push_back(" [the following flags]"); //1 and 2 sandwich a variable
help.push_back("\033[1m-f \033[3mfile\033[0m or \033[1m--server-file \033[3mfile \033[0m\033[1m|\033[0m Specify a server configuration file to use manually.");
Expand Down

0 comments on commit 6f18617

Please sign in to comment.