@@ -1569,6 +1569,7 @@ void my_print_help(const struct my_option *options)
15691569 for (optp = options ; optp -> name ; optp ++ )
15701570 {
15711571 const char * typelib_help = 0 ;
1572+ my_bool skip_or_all_message = 0 ;
15721573 if (!optp -> comment )
15731574 continue ;
15741575 if (optp -> id && optp -> id < 256 )
@@ -1612,6 +1613,7 @@ void my_print_help(const struct my_option *options)
16121613 if (optp -> comment && * optp -> comment )
16131614 {
16141615 uint count ;
1616+ uint hidden_value_count = 0 ;
16151617
16161618 if (col > name_space )
16171619 {
@@ -1632,8 +1634,22 @@ void my_print_help(const struct my_option *options)
16321634 count = optp -> typelib -> count ;
16331635 break ;
16341636 case GET_SET :
1635- typelib_help = ". Any combination of: " ;
1637+ if (optp -> typelib -> hidden_values )
1638+ {
1639+ /* Count how many values are hidden */
1640+ for (const int * val = optp -> typelib -> hidden_values ; * val >= 0 ; val ++ )
1641+ hidden_value_count ++ ;
1642+ }
16361643 count = optp -> typelib -> count ;
1644+ if (count == hidden_value_count )
1645+ {
1646+ /* All values are hidden */
1647+ typelib_help = ". No currently supported values." ;
1648+ count = 0 ;
1649+ skip_or_all_message = 1 ;
1650+ }
1651+ else
1652+ typelib_help = ". Any combination of: " ;
16371653 break ;
16381654 case GET_FLAGSET :
16391655 typelib_help = ". Takes a comma-separated list of option=value pairs, "
@@ -1645,9 +1661,9 @@ void my_print_help(const struct my_option *options)
16451661 strstr (optp -> comment , optp -> typelib -> type_names [0 ]) == NULL )
16461662 {
16471663 uint i ;
1664+ my_bool printing_first = 1 ;
16481665 col = print_comment (typelib_help , col , name_space , comment_space );
1649- col = print_comment (optp -> typelib -> type_names [0 ], col , name_space , comment_space );
1650- for (i = 1 ; i < count ; i ++ )
1666+ for (i = 0 ; i < count ; i ++ )
16511667 {
16521668 my_bool skip_value = 0 ;
16531669 /* Do not print the value if it is listed in hidden_values */
@@ -1665,7 +1681,10 @@ void my_print_help(const struct my_option *options)
16651681 }
16661682 if (skip_value )
16671683 continue ;
1668- col = print_comment (", " , col , name_space , comment_space );
1684+ if (printing_first )
1685+ printing_first = 0 ;
1686+ else
1687+ col = print_comment (", " , col , name_space , comment_space );
16691688 col = print_comment (optp -> typelib -> type_names [i ], col , name_space , comment_space );
16701689 }
16711690 }
@@ -1681,7 +1700,7 @@ void my_print_help(const struct my_option *options)
16811700 printf (" to disable.)\n" );
16821701 }
16831702 }
1684- else if ((optp -> var_type & GET_TYPE_MASK ) == GET_SET )
1703+ else if ((optp -> var_type & GET_TYPE_MASK ) == GET_SET && ! skip_or_all_message )
16851704 printf (" Use 'ALL' to set all combinations.\n" );
16861705 }
16871706 DBUG_VOID_RETURN ;
0 commit comments