quit command and verbosity
[minishell-2.git] / Sources / main.cpp
blob3424c3a7e91063dd2b54c119fc3935cb37302ded
1 #include "Headers/opsys.h"
3 int main(int argc, char ** argv)
5 cout << "miniSHELL 2 -- github.com/vrmiguel/minishell2\n";
6 CLIInputs(argc, argv); // Process command-line arguments
7 Prompt prompt;
8 SignalHandler sighandler;
9 for(;;)
11 if (exit_program) return 0; // Tests for SIGINT/SIGHUP
12 string line;
13 prompt.print();
14 std::getline(cin, line);
15 if (exit_program) return 0; // Tests for "quit"
16 if (cin.eof())
18 cout << "\nEOF found. Exiting.\n";
19 return 0;
21 if(line.empty())
22 continue;
23 prompt.parse(line);
24 prompt.run();
26 return 0;