Piped commands (almost) working
[minishell-2.git] / Sources / main.cpp
blobff920cbf54f51a89a56a65518b124a93c857d571
1 #include "Headers/opsys.h"
3 using std::cin;
4 using std::cout;
6 int main(int argc, char ** argv)
8 cout << "miniSHELL 2 -- github.com/vrmiguel/minishell2\n";
9 CLIInputs(argc, argv); // Process command-line arguments
10 Prompt prompt;
11 SignalHandler sighandler;
12 for(;;)
14 if (exit_program) return 0; // Tests for SIGINT/SIGHUP
15 string line;
16 prompt.print();
17 std::getline(cin, line);
19 if (exit_program) return 0; // Tests for "quit"
20 if (cin.eof())
22 cout << "\nEOF found. Exiting.\n";
23 return 0;
25 if(line.empty())
26 continue;
27 prompt.parse(line);
28 prompt.run();
30 return 0;