Skip to content

Commit

Permalink
Now you can get to know the version and exit properly.
Browse files Browse the repository at this point in the history
  • Loading branch information
Tech-FZ committed Apr 13, 2023
1 parent 1a01b2c commit d8009ee
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 6 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# NShell Changelog

## Build 3

- Okay, now version and exit do something.

## Build 2

- Now you can type something in, but then it just says goodbye.
Expand Down
25 changes: 19 additions & 6 deletions main.cpp
Original file line number Diff line number Diff line change
@@ -1,19 +1,32 @@
#include <iostream>
#include <limits>

int buildNr = 2;
int buildNr = 3;

int main()
{
std::cout << "NShell" << '\n';
std::cout << "Build: " << buildNr << '\n';
std::cout << "Early prototype! Don't expect it to be useful." << '\n';
std::cout << "Early prototype! Don't expect it to be useful.\n" << '\n';

std::cout << "NShell > ";
std::string command_to_run;
std::cin >> command_to_run;
while (true) {
std::cout << "NShell > ";
std::string command_to_run;
std::cin >> command_to_run;

std::cout << "You would have run " << command_to_run << ". Thanks for testing. Goodbye.";
if (command_to_run == "version") {
std::cout << "NShell Build " << buildNr << '\n';
}

else if (command_to_run == "exit") {
std::cout << "Goodbye. Please press Enter to exit the application." << '\n';
break;
}

else {
std::cout << "Unknown command!\n";
}
}

std::cin.clear();
std::cin.ignore(std::numeric_limits<std::streamsize>::max(), '\n');
Expand Down

0 comments on commit d8009ee

Please sign in to comment.