1 /++
2     Dummy main module so all the real files get tested by dub.
3 
4     See_Also:
5         [kameloso.main]
6 
7     Copyright: [JR](https://github.com/zorael)
8     License: [Boost Software License 1.0](https://www.boost.org/users/license.html)
9 
10     Authors:
11         [JR](https://github.com/zorael)
12  +/
13 module kameloso.entrypoint;
14 
15 public:
16 
17 version(unittest)
18 {
19     /++
20         Unit-testing main; does nothing.
21      +/
22     void main() {}
23 }
24 else
25 {
26     /++
27         Entry point of the program.
28 
29         Technically it just passes on execution to [kameloso.main.run].
30 
31         Params:
32             args = Command-line arguments passed to the program.
33 
34         Returns:
35             `0` on success, non-`0` on failure.
36      +/
37     int main(string[] args)
38     {
39         import kameloso.main : run;
40 
41         scope(exit)
42         {
43             import std.stdio : stdout;
44             import core.thread : thread_joinAll;
45 
46             // Unsure if this is ever needed, but just in case the buffer isn't
47             // flushing on linebreaks and wouldn't get flushed on exit
48             stdout.flush();
49 
50             // To be tidy, join threads.
51             thread_joinAll();
52         }
53 
54         return run(args);
55     }
56 }