A quick and dirty shell implementation for A.U.TH. (Operating systems Lab)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

33 lines
700 B

  1. #include "sequencer.h"
  2. int main(int argc, char* argv[]) try {
  3. snel::Sequencer s{};
  4. std::string line;
  5. if (argc > 1) { // batch mode
  6. std::ifstream file(argv[1]);
  7. while (std::getline (file, line, '\n')) {
  8. s.parse(line).execute();
  9. }
  10. }
  11. else { // interactive mode
  12. std::cout << "Snel. A quick and dirty shell implementation for auth.gr" << std::endl;
  13. do {
  14. std::cout << "Choutouridis_8997>";
  15. std::getline (std::cin, line, '\n');
  16. if (line == "quit")
  17. break;
  18. s.parse(line).execute();
  19. } while (1);
  20. }
  21. return 0;
  22. }
  23. catch (std::exception& e) {
  24. std::cerr << e.what() << '\n';
  25. exit(1);
  26. }