Explorar o código

More informative errors when enter is pressed

git-svn-id: https://klish.googlecode.com/svn/trunk@365 0eaa4687-2ee9-07dd-09d9-bcdd2d2dd5fb
Serj Kalichev %!s(int64=13) %!d(string=hai) anos
pai
achega
566df81b94
Modificáronse 1 ficheiros con 9 adicións e 4 borrados
  1. 9 4
      clish/shell/shell_tinyrl.c

+ 9 - 4
clish/shell/shell_tinyrl.c

@@ -272,15 +272,20 @@ static bool_t clish_shell_tinyrl_key_enter(tinyrl_t * this, int key)
 				result = BOOL_TRUE;
 				break;
 			case CLISH_BAD_HISTORY:
+				fprintf(stderr, "Error: Bad history entry.\n");
+				break;
 			case CLISH_BAD_CMD:
+				fprintf(stderr, "Error: Illegal command line.\n");
+				break;
 			case CLISH_BAD_PARAM:
+				fprintf(stderr, "Error: Illegal parameter.\n");
+				break;
 			case CLISH_LINE_PARTIAL:
-				tinyrl_crlf(this);
-				fprintf(stderr, "Error. Illegal command line.\n");
-				tinyrl_crlf(this);
-				tinyrl_reset_line_state(this);
+				fprintf(stderr, "Error: The command is not completed.\n");
 				break;
 			}
+			if (CLISH_LINE_OK != arg_status)
+				tinyrl_reset_line_state(this);
 		}
 	} else {
 		/* nothing to pass simply move down the screen */