File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -58,18 +58,19 @@ void show_brief_help() {
5858}
5959
6060void command_help (const char *selection) {
61- int len = strlen (selection);
6261 bool found = false ;
62+ const char *pattern = " %s\033 [50D\033 [14C%s\n " ;
6363 for (int i = 0 ; i < keyword_help_len; i++) {
64- if (strncasecmp (selection, keyword_help[i].keyword , len ) == 0 ) {
65- fprintf (stdout, " %s : %s \n " , keyword_help[i].keyword , keyword_help[i].help );
64+ if (selection[ 0 ] == ' ? ' || strcasecmp (selection, keyword_help[i].package ) == 0 ) {
65+ fprintf (stdout, pattern , keyword_help[i].keyword , keyword_help[i].help );
6666 found = true ;
6767 }
6868 }
6969 if (!found) {
70+ int len = strlen (selection);
7071 for (int i = 0 ; i < keyword_help_len; i++) {
71- if (strncasecmp (selection, keyword_help[i].package , len) == 0 ) {
72- fprintf (stdout, " %s : %s \n " , keyword_help[i].keyword , keyword_help[i].help );
72+ if (strncasecmp (selection, keyword_help[i].keyword , len) == 0 ) {
73+ fprintf (stdout, pattern , keyword_help[i].keyword , keyword_help[i].help );
7374 found = true ;
7475 }
7576 }
You can’t perform that action at this time.
0 commit comments