Skip to content

Commit

Permalink
Written a better help message in case of invalid invocation.
Browse files Browse the repository at this point in the history
  • Loading branch information
FlatAssembler committed Jun 28, 2021
1 parent f291c74 commit 0d4fd19
Showing 1 changed file with 20 additions and 2 deletions.
22 changes: 20 additions & 2 deletions AECforWebAssembly.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,26 @@ int main(int argc, char **argv) {
// yet it miscompiles something every now and
// then in a 5'000-lines-of-code program.
throw regex_error(error_complexity);
cerr << "Please invoke this program as follows:\n"
<< argv[0] << " name_of_the_program.aec" << endl;
cerr << "Please invoke this program as follows, from the command line:\n"
<< argv[0] << " name_of_the_program.aec" << '\n'
<< "Or, alternatively, open an AEC source code with this program.\n"
"For more information, see:\n"
"https://flatassembler.github.io/AEC_specification.html#HowToCompile \n"
"TL;DR\n"
"An example AEC program can be downloaded here:\n"
"https://sourceforge.net/p/aecforwebassembly/code/ci/master/tree/analogClock/analogClock.aec?format=raw \n"
"You need to assemble the result using a program called \"wat2wasm\"\n"
"from WebAssembly Binary Toolkit, perhaps like this\n"
"(if you have NodeJS installed and an Internet connection):\n"
"npx -p wabt wat2wasm analogClock.wat\n"
"Then you need to write a JavaScript program runnable in NodeJS\n"
"which will invoke that AEC program, an example is available here:\n"
"https://sourceforge.net/p/aecforwebassembly/code/ci/master/tree/analogClock/analogClock.js?format=raw \n"
"And then, of course, you can run that program in NodeJS."
<<endl;
#ifdef WIN32
system("PAUSE");
#endif // WIN32
return -1;
}
} catch (regex_error &error) {
Expand Down

0 comments on commit 0d4fd19

Please sign in to comment.