From 153a6c9467badbea6259db90e1b99603a05851e6 Mon Sep 17 00:00:00 2001 From: wjoe Date: Tue, 8 May 2012 12:28:52 +0100 Subject: Added help message --- blarandom.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'blarandom.cpp') 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; -- cgit v1.2.3