Skip to content

Commit 9693073

Browse files
monyarmPetarKirov
authored andcommitted
feat(mcl/utils/log): Implement errorAndExit function
1 parent 40dac52 commit 9693073

File tree

1 file changed

+9
-0
lines changed
  • packages/mcl/src/src/mcl/utils

1 file changed

+9
-0
lines changed

packages/mcl/src/src/mcl/utils/log.d

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
module mcl.utils.log;
22

3+
4+
void errorAndExit(string message) {
5+
import core.stdc.stdlib: exit;
6+
import std.stdio : stderr;
7+
8+
stderr.writeln(message);
9+
exit(1);
10+
}
11+
312
T prompt(T)(string message, T[] options = [], string input = "unfilled")
413
{
514
import std.stdio : write, writeln, readln;

0 commit comments

Comments
 (0)