summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwjoe <joe@lc8n.com>2012-05-08 12:28:52 +0100
committerwjoe <joe@lc8n.com>2012-05-08 12:28:52 +0100
commit153a6c9467badbea6259db90e1b99603a05851e6 (patch)
treedcae6cc4c1988a8f2de64e04bfcf1778a54c73bd
parentfd8ba0c49772daced43e8b3e7de95fac1d15e127 (diff)
Added help message
-rw-r--r--blarandom.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/blarandom.cpp b/blarandom.cpp
index 4db224e..2a6136b 100644
--- a/blarandom.cpp
+++ b/blarandom.cpp
@@ -22,6 +22,7 @@
v0.1 - Initial release
v0.2 - Added Makefile
+ v0.3 - Added help
*/
@@ -54,10 +55,16 @@ int main() {
iss >> args[i];
}
- if (!args[0].compare("-v")) {
+ if (!args[0].compare("-v") || !args[0].compare("--version")) {
std::cout << "v" << version << std::endl;
return 0;
}
+
+ if (!args[0].compare("-h") || !args[0].compare("--help")) {
+ std::cout << "Usage: !random [minimum bound] [maximum bound] [count] | Examples: !random : returns a number from 1 to 10 | !random 20 : Returns a number from 1 to 20 | !random 10 20 : Returns a number from 10 to 20 | !random 1 10 3 : Returns 3 random numbers from 1 to 10" << std::endl;
+ return 0;
+ }
+
if (args[2].empty()) {
count = 1;