summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNullspoon <nullspoon@iohq.net>2014-09-25 22:52:10 -0600
committerNullspoon <nullspoon@iohq.net>2014-09-25 22:52:10 -0600
commit296964fac1f787422a1d13e70a01c4a9d78e1805 (patch)
treeaad985d339ebb3a05ec41244dae2881083ac29b3
parentacdfcfcdac2794793f8dd045f8c9b26cb0bf0356 (diff)
downloadnoteless-296964fac1f787422a1d13e70a01c4a9d78e1805.tar.gz
noteless-296964fac1f787422a1d13e70a01c4a9d78e1805.tar.xz
Fixed out of bound exception on no arguments
When checking for the first argument being init, we assumed that there was a first argument. Now checks for argument count being greater than 0 and prints the help text if it is not.
-rw-r--r--src/main.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/main.cpp b/src/main.cpp
index aee94e3..cfc5dd7 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -129,6 +129,11 @@ int main( int argc, char** argv ) {
}
}
+ if( argc == 1 ) {
+ cout << "\nNo command specified. Printing help text.\n" << endl;
+ return get_help();
+ }
+
// If the init command was passed, we want to init before checking if the
// note path exists, otherwise the error will display and the store will
// never be initialized.

Generated by cgit