diff options
-rw-r--r-- | pcoin.cpp | 7 | ||||
-rw-r--r-- | tcoin.cpp | 7 |
2 files changed, 8 insertions, 6 deletions
diff --git a/pcoin.cpp b/pcoin.cpp index 5bf1b79..b6f2f8f 100644 --- a/pcoin.cpp +++ b/pcoin.cpp @@ -55,6 +55,7 @@ #define ERR_MAIN_SEND_TOO_FEW_ARGS 6 #define ERR_MAIN_SEND_TOO_MANY_ARGS 7 +#define ERR_MAIN_SEND_TOO_MANY_ARGS_MSG 104 #define ERR_SILENTSEND 2 #define ERR_MAIN_MSG_TOO_LONG 19 #define ERR_UNKNOWN_ARG 3 @@ -1942,8 +1943,9 @@ int main(int argc, char *argv[]) } else { - //too many command-line arguments were passed (6 args) - goto LABEL_TOO_MANY_ARGS; + //too many command-line arguments were passed (6 args) (probably a message was intended) + std::cout << "\nSorry, too many command-line arguments were passed. The correct format is `tcoin send <username> <amount> \"<message>\"`.\n\n"; + return ERR_MAIN_SEND_TOO_MANY_ARGS_MSG; } } else if(argc < 4) @@ -1953,7 +1955,6 @@ int main(int argc, char *argv[]) } else if(argc > 4) { - LABEL_TOO_MANY_ARGS: std::cout << "\nSorry, too many command-line arguments were passed. The correct format is `" << PCOIN_BIN_PATH_W_SPACE << "send <username> <amount>`.\n\n"; return ERR_MAIN_SEND_TOO_MANY_ARGS; } diff --git a/tcoin.cpp b/tcoin.cpp index a382746..faeb617 100644 --- a/tcoin.cpp +++ b/tcoin.cpp @@ -64,6 +64,7 @@ #define ERR_NOT_LOGGED_IN 5 #define ERR_MAIN_SEND_TOO_FEW_ARGS 6 #define ERR_MAIN_SEND_TOO_MANY_ARGS 7 +#define ERR_MAIN_SEND_TOO_MANY_ARGS_MSG 104 #define ERR_MAIN_MSG_TOO_LONG 19 #define ERR_SILENTSEND 2 #define ERR_UNKNOWN_ARG 3 @@ -1800,8 +1801,9 @@ int main(int argc, char *argv[]) } else { - //too many command-line arguments were passed (6 args) - goto LABEL_TOO_MANY_ARGS; + //too many command-line arguments were passed (6 args) (probably a message was intended) + std::cout << "\nSorry, too many command-line arguments were passed. The correct format is `tcoin send <username> <amount> \"<message>\"`.\n\n"; + return ERR_MAIN_SEND_TOO_MANY_ARGS_MSG; } } else if(argc < 4) @@ -1811,7 +1813,6 @@ int main(int argc, char *argv[]) } else if(argc > 4) { - LABEL_TOO_MANY_ARGS: std::cout << "\nSorry, too many command-line arguments were passed. The correct format is `tcoin send <username> <amount>`.\n\n"; return ERR_MAIN_SEND_TOO_MANY_ARGS; } |