Skip to content

Commit fdae940

Browse files
committed
Added help command
1 parent 2617b27 commit fdae940

File tree

6 files changed

+33
-5
lines changed

6 files changed

+33
-5
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# NShell Changelog
22

3+
## Build 5
4+
5+
- ErikTheRDev added c.version and updated version.
6+
- A contributors file has been added.
7+
- A help command has been added as well.
8+
39
## Build 4
410

511
- You no longer have to press Enter to exit the application.

NShell.depend

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# depslib dependency file v1.0
2-
1681378820 source:d:\nicos code\shell\nshell\nshell\main.cpp
2+
1681493466 source:d:\nicos code\shell\nshell\nshell\main.cpp
3+
"help.h"
34
<iostream>
4-
<limits>
5+
6+
1681493184 d:\nicos code\shell\nshell\nshell\help.h
57

NShell.layout

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<ActiveTarget name="Release" />
55
<File name="main.cpp" open="1" top="1" tabpos="1" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
66
<Cursor>
7-
<Cursor1 position="58" topLine="0" />
7+
<Cursor1 position="19" topLine="0" />
88
</Cursor>
99
</File>
1010
</CodeBlocks_layout_file>

help.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#include "help.h"
2+
#include <iostream>
3+
4+
void help_generic() {
5+
std::cout << "help - Shows this, what else do I have to say?\n";
6+
std::cout << "version - Shows the NShell build number.\n";
7+
std::cout << "c.version - Same as version, but in a single line.\n";
8+
std::cout << "exit - Closes the NShell.\n";
9+
}

help.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#ifndef HELP_H_INCLUDED
2+
#define HELP_H_INCLUDED
3+
4+
void help_generic();
5+
6+
#endif // HELP_H_INCLUDED

main.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1+
#include "help.h"
12
#include <iostream>
23

3-
int buildNr = 4;
4+
int buildNr = 5;
45

56
int main()
67
{
@@ -16,11 +17,15 @@ int main()
1617
if (command_to_run == "version") {
1718
std::cout << "NShell\n" << "Build " << buildNr << '\n';
1819
}
19-
20+
2021
else if (command_to_run == "c.version") {
2122
std::cout << "NShell Build " << buildNr << '\n';
2223
}
2324

25+
else if (command_to_run == "help") {
26+
help_generic();
27+
}
28+
2429
else if (command_to_run == "exit") {
2530
break;
2631
}

0 commit comments

Comments
 (0)