File tree Expand file tree Collapse file tree 2 files changed +23
-6
lines changed
Expand file tree Collapse file tree 2 files changed +23
-6
lines changed Original file line number Diff line number Diff line change 11# NShell Changelog
22
3+ ## Build 3
4+
5+ - Okay, now version and exit do something.
6+
37## Build 2
48
59- Now you can type something in, but then it just says goodbye.
Original file line number Diff line number Diff line change 11#include < iostream>
22#include < limits>
33
4- int buildNr = 2 ;
4+ int buildNr = 3 ;
55
66int main ()
77{
88 std::cout << " NShell" << ' \n ' ;
99 std::cout << " Build: " << buildNr << ' \n ' ;
10- std::cout << " Early prototype! Don't expect it to be useful." << ' \n ' ;
10+ std::cout << " Early prototype! Don't expect it to be useful.\n " << ' \n ' ;
1111
12- std::cout << " NShell > " ;
13- std::string command_to_run;
14- std::cin >> command_to_run;
12+ while (true ) {
13+ std::cout << " NShell > " ;
14+ std::string command_to_run;
15+ std::cin >> command_to_run;
1516
16- std::cout << " You would have run " << command_to_run << " . Thanks for testing. Goodbye." ;
17+ if (command_to_run == " version" ) {
18+ std::cout << " NShell Build " << buildNr << ' \n ' ;
19+ }
20+
21+ else if (command_to_run == " exit" ) {
22+ std::cout << " Goodbye. Please press Enter to exit the application." << ' \n ' ;
23+ break ;
24+ }
25+
26+ else {
27+ std::cout << " Unknown command!\n " ;
28+ }
29+ }
1730
1831 std::cin.clear ();
1932 std::cin.ignore (std::numeric_limits<std::streamsize>::max (), ' \n ' );
You can’t perform that action at this time.
0 commit comments