A quick and dirty shell implementation for A.U.TH. (Operating systems Lab)
Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.
 
 
 

33 linhas
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. }