diff --git a/.vscode/launch.json b/.vscode/launch.json index 14e5033..53db987 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -5,7 +5,7 @@ "version": "0.2.0", "configurations": [ { - "name": "(lldb) Launch", + "name": "usql", "type": "cppdbg", "request": "launch", "program": "${workspaceFolder}/build/usql", @@ -15,6 +15,18 @@ "environment": [], "externalConsole": false, "MIMode": "lldb" + }, + { + "name": "usql -debug", + "type": "cppdbg", + "request": "launch", + "program": "${workspaceFolder}/build/usql", + "args": ["-debug"], + "stopAtEntry": false, + "cwd": "${fileDirname}", + "environment": [], + "externalConsole": false, + "MIMode": "lldb" } ] } \ No newline at end of file diff --git a/main.cpp b/main.cpp index e485588..407ab9c 100644 --- a/main.cpp +++ b/main.cpp @@ -147,11 +147,11 @@ void debug() { int main(int argc, char *argv[]) { -// #ifdef NDEBUG -// repl(); -// #else - debug(); -// #endif + if (argc == 2 && strcpy(argv[1], "-debug")) { + debug(); + } else { + repl(); + } return 0; }