06165b54e76c9167888c93182090c333f4a49b78
[ghc.git] / driver / ghci / ghci.c
1
2 #include "cwrapper.h"
3 #include "getLocation.h"
4 #include <errno.h>
5 #include <process.h>
6 #include <stdio.h>
7 #include <stdlib.h>
8 #include <stdarg.h>
9 #include <string.h>
10
11 int main(int argc, char** argv) {
12 char *binDir;
13 char *exePath;
14 char *preArgv[1];
15
16 if (getenv("_")) {
17 printf("WARNING: GHCi invoked via 'ghci.exe' in *nix-like shells (cygwin-bash, in particular)\n");
18 printf(" doesn't handle Ctrl-C well; use the 'ghcii.sh' shell wrapper instead\n");
19 fflush(stdout);
20 }
21
22 binDir = getExecutablePath();
23 exePath = mkString("%s/ghc.exe", binDir);
24 preArgv[0] = "--interactive";
25
26 run(exePath, 1, preArgv, argc - 1, argv + 1);
27 }
28