@@ -1647,6 +1647,8 @@ void my_print_help(const struct my_option *options)
16471647 if (optp -> comment && * optp -> comment )
16481648 {
16491649 uint count ;
1650+ uint hidden_value_count = 0 ;
1651+ my_bool skip_or_all_message = 0 ;
16501652
16511653 if (col > name_space )
16521654 {
@@ -1667,8 +1669,22 @@ void my_print_help(const struct my_option *options)
16671669 count = optp -> typelib -> count ;
16681670 break ;
16691671 case GET_SET :
1670- typelib_help = ". Any combination of: " ;
1672+ if (optp -> typelib -> hidden_values )
1673+ {
1674+ /* Count how many values are hidden */
1675+ for (const int * val = optp -> typelib -> hidden_values ; * val >= 0 ; val ++ )
1676+ hidden_value_count ++ ;
1677+ }
16711678 count = optp -> typelib -> count ;
1679+ if (count == hidden_value_count )
1680+ {
1681+ /* All values are hidden */
1682+ typelib_help = ". No currently supported values." ;
1683+ count = 0 ;
1684+ skip_or_all_message = 1 ;
1685+ }
1686+ else
1687+ typelib_help = ". Any combination of: " ;
16721688 break ;
16731689 case GET_FLAGSET :
16741690 typelib_help = ". Takes a comma-separated list of option=value pairs, "
@@ -1680,9 +1696,9 @@ void my_print_help(const struct my_option *options)
16801696 strstr (optp -> comment , optp -> typelib -> type_names [0 ]) == NULL )
16811697 {
16821698 uint i ;
1699+ my_bool printing_first = 1 ;
16831700 col = print_comment (typelib_help , col , name_space , comment_space );
1684- col = print_comment (optp -> typelib -> type_names [0 ], col , name_space , comment_space );
1685- for (i = 1 ; i < count ; i ++ )
1701+ for (i = 0 ; i < count ; i ++ )
16861702 {
16871703 my_bool skip_value = 0 ;
16881704 /* Do not print the value if it is listed in hidden_values */
@@ -1700,11 +1716,14 @@ void my_print_help(const struct my_option *options)
17001716 }
17011717 if (skip_value )
17021718 continue ;
1703- col = print_comment (", " , col , name_space , comment_space );
1719+ if (printing_first )
1720+ printing_first = 0 ;
1721+ else
1722+ col = print_comment (", " , col , name_space , comment_space );
17041723 col = print_comment (optp -> typelib -> type_names [i ], col , name_space , comment_space );
17051724 }
17061725 }
1707- if ((optp -> var_type & GET_TYPE_MASK ) == GET_SET )
1726+ if ((optp -> var_type & GET_TYPE_MASK ) == GET_SET && ! skip_or_all_message )
17081727 col = print_comment (", or ALL to set all combinations" , col , name_space , comment_space );
17091728 if (optp -> deprecation_substitute != NULL )
17101729 {
0 commit comments