Index: kernel/generic/include/console/kconsole.h
===================================================================
--- kernel/generic/include/console/kconsole.h	(revision b6bbc74b63bc4fbd88824dc1c87c59ea24fcff28)
+++ kernel/generic/include/console/kconsole.h	(revision 36b0490e0aa22bd717934559549ed926a2a17f61)
@@ -42,4 +42,7 @@
 #define MAX_CMDLINE       256
 #define KCONSOLE_HISTORY  10
+
+/** Callback to be used to enum hints for cmd tab completion. */
+typedef const char *(*hints_enum_func_t)(const char *, const char **, void **);
 
 typedef enum {
Index: kernel/generic/src/console/kconsole.c
===================================================================
--- kernel/generic/src/console/kconsole.c	(revision b6bbc74b63bc4fbd88824dc1c87c59ea24fcff28)
+++ kernel/generic/src/console/kconsole.c	(revision 36b0490e0aa22bd717934559549ed926a2a17f61)
@@ -165,7 +165,8 @@
 
 /** Try to find a command beginning with prefix */
-NO_TRACE static const char *cmdtab_search_one(const char *name,
-    link_t **startpos)
-{
+NO_TRACE static const char *cmdtab_enum(const char *name,
+    const char **h, void **ctx)
+{
+	link_t **startpos = (link_t**)ctx;
 	size_t namelen = str_length(name);
 	
@@ -183,4 +184,8 @@
 		
 		if (str_lcmp(curname, name, namelen) == 0) {
+			*startpos = (*startpos)->next;
+			if (h) {
+				*h = hlp->description;
+			}
 			spinlock_unlock(&cmd_lock);
 			return (curname + str_lsize(curname, namelen));
@@ -200,5 +205,6 @@
  *
  */
-NO_TRACE static int cmdtab_compl(char *input, size_t size, indev_t *indev)
+NO_TRACE static int cmdtab_compl(char *input, size_t size, indev_t *indev,
+    hints_enum_func_t hints_enum)
 {
 	const char *name = input;
@@ -212,7 +218,7 @@
 	size_t max_match_len = size;
 	size_t max_match_len_tmp = size;
-	size_t input_len = str_length(input);
-	link_t *pos = NULL;
+	void *pos = NULL;
 	const char *hint;
+	const char *help;
 	char *output = malloc(MAX_CMDLINE, 0);
 	size_t hints_to_show = MAX_TAB_HINTS - 1;
@@ -222,9 +228,8 @@
 	output[0] = 0;
 	
-	while ((hint = cmdtab_search_one(name, &pos))) {
+	while ((hint = hints_enum(name, NULL, &pos))) {
 		if ((found == 0) || (str_length(output) > str_length(hint)))
 			str_cpy(output, MAX_CMDLINE, hint);
 		
-		pos = pos->next;
 		found++;
 	}
@@ -243,9 +248,13 @@
 		printf("\n");
 		pos = NULL;
-		while (cmdtab_search_one(name, &pos)) {
-			cmd_info_t *hlp = list_get_instance(pos, cmd_info_t, link);
+		while ((hint = hints_enum(name, &help, &pos))) {
 			
 			if (continue_showing_hints) {
-				printf("%s (%s)\n", hlp->name, hlp->description);
+				
+				if (help)
+					printf("%s%s (%s)\n", name, hint, help);
+				else
+					printf("%s%s\n", name, hint);
+				
 				--hints_to_show;
 				++total_hints_shown;
@@ -258,9 +267,7 @@
 			}
 			
-			pos = pos->next;
-			
 			for (max_match_len_tmp = 0;
 			    (output[max_match_len_tmp] ==
-			    hlp->name[input_len + max_match_len_tmp]) &&
+			    hint[max_match_len_tmp]) &&
 			    (max_match_len_tmp < max_match_len); ++max_match_len_tmp);
 			
@@ -338,5 +345,5 @@
 			if (beg == 0) {
 				/* Command completion */
-				found = cmdtab_compl(tmp, STR_BOUNDS(MAX_CMDLINE), indev);
+				found = cmdtab_compl(tmp, STR_BOUNDS(MAX_CMDLINE), indev, cmdtab_enum);
 			} else {
 				/* Symbol completion */
