Skip to content

Commit 52553a9

Browse files
committed
Added proper --help command
1 parent 157ba33 commit 52553a9

File tree

1 file changed

+20
-3
lines changed

1 file changed

+20
-3
lines changed

include/commands.hpp

+20-3
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,37 @@ using namespace std;
88
namespace command {
99
bool version(argCVDef) {
1010
std::cout << dye::light_green("Eval ") << dye::light_green(__VERSION);
11-
std::cout << dye::grey(" (C)codeAbinash ") << dye::light_yellow(__version_date) << std::endl;
11+
std::cout << dye::grey(" (C)codeAbinash ")
12+
<< dye::light_yellow(__version_date) << std::endl;
1213
return true;
1314
}
1415

1516
bool help(argCVDef) {
16-
cout << "Visit " << dye::light_blue("https://github.com/codeAbinash/eval") << " for more information." << endl;
17+
version(argCV);
18+
cout << endl;
19+
cout << dye::grey("Available Commands : ") << endl << endl;
20+
cout << dye::light_yellow(" --help") << " : Find some help" << endl;
21+
cout << dye::light_yellow(" --version")
22+
<< " : Check the current version of eval" << endl
23+
<< endl;
24+
cout << dye::grey("How to use : ") << endl << endl;
25+
cout << "Write `" << dye::light_yellow("eval")
26+
<< dye::light_blue(" \"expression\"`") << " to evaluate an expression."
27+
<< endl;
28+
cout << "Or you can write " << dye::light_yellow("`eval`")
29+
<< " to enter more than one expression." << endl
30+
<< endl;
31+
cout << "Visit " << dye::light_blue("https://github.com/codeAbinash/eval")
32+
<< " for more information." << endl;
1733
return true;
1834
}
1935

2036
bool unknownCommand(argCVDef) {
2137
cout << "Unknown command "
2238
<< "`" << dye::light_yellow(argv[1]) << "`" << endl;
2339
cout << dye::grey("Akta command o valo kore lekhte parche na :) !") << endl;
24-
cout << "Use " << dye::light_yellow("`eval --help`") << " for more information." << endl;
40+
cout << "Use " << dye::light_yellow("`eval --help`")
41+
<< " for more information." << endl;
2542
return false;
2643
}
2744
} // namespace command

0 commit comments

Comments
 (0)