diff options
author | charmlesscoin <charmlesscoin@gmail.com> | 2013-08-03 16:12:02 -0400 |
---|---|---|
committer | charmlesscoin <charmlesscoin@gmail.com> | 2013-08-03 16:12:02 -0400 |
commit | 9b56e21f81b0956e936a605f2b82d61eecd3d435 (patch) | |
tree | 285675294fd6ec0417ed8829d17a1321d4604e00 /testing/toxic/main.c | |
parent | d34e4a3408a176525bedfad87cfc996afbe21b66 (diff) |
added a proper error message for messing up the -f flag
Diffstat (limited to 'testing/toxic/main.c')
-rw-r--r-- | testing/toxic/main.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/testing/toxic/main.c b/testing/toxic/main.c index 001d3382..3b45a89f 100644 --- a/testing/toxic/main.c +++ b/testing/toxic/main.c | |||
@@ -283,6 +283,7 @@ void prepare_window(WINDOW* w) { | |||
283 | int main(int argc, char* argv[]) { | 283 | int main(int argc, char* argv[]) { |
284 | int ch; | 284 | int ch; |
285 | int i = 0; | 285 | int i = 0; |
286 | int f_flag = 0; | ||
286 | char *filename = "data"; | 287 | char *filename = "data"; |
287 | ToxWindow* a; | 288 | ToxWindow* a; |
288 | 289 | ||
@@ -292,7 +293,7 @@ int main(int argc, char* argv[]) { | |||
292 | if(argv[i + 1] != NULL) | 293 | if(argv[i + 1] != NULL) |
293 | filename = argv[i + 1]; | 294 | filename = argv[i + 1]; |
294 | else { | 295 | else { |
295 | fputs("[!] you passed '-f' without giving an argument!\n", stderr); | 296 | f_flag = -1; |
296 | } | 297 | } |
297 | } | 298 | } |
298 | } | 299 | } |
@@ -303,6 +304,14 @@ int main(int argc, char* argv[]) { | |||
303 | load_data(filename); | 304 | load_data(filename); |
304 | init_windows(); | 305 | init_windows(); |
305 | 306 | ||
307 | if(f_flag == -1) { | ||
308 | attron(COLOR_PAIR(3) | A_BOLD); | ||
309 | wprintw(prompt->window, "You passed '-f' without giving an argument!\n" | ||
310 | "defaulting to 'data' for a keyfile...\n"); | ||
311 | attroff(COLOR_PAIR(3) | A_BOLD); | ||
312 | } | ||
313 | |||
314 | |||
306 | while(true) { | 315 | while(true) { |
307 | // Update tox. | 316 | // Update tox. |
308 | do_tox(); | 317 | do_tox(); |