@@ -96,6 +96,10 @@ class FieldMetadata(Generic[T]):
96
96
#: Help text documenting the field.
97
97
help : Optional [str ] = None
98
98
99
+ #: Specific values that should be shown in the documentation as
100
+ #: interesting examples of the field usage.
101
+ help_example_values : list [str ] = simple_field (default_factory = list )
102
+
99
103
#: If field accepts a value, this string would represent it in documentation.
100
104
#: This stores the metavar provided when field was created - it may be unset.
101
105
#: py:attr:`metavar` provides the actual metavar to be used.
@@ -666,6 +670,7 @@ def field(
666
670
envvar : Optional [str ] = None ,
667
671
deprecated : Optional ['tmt.options.Deprecated' ] = None ,
668
672
help : Optional [str ] = None ,
673
+ help_example_values : Optional [list [str ]] = None ,
669
674
show_default : bool = False ,
670
675
internal : bool = False ,
671
676
# Input data normalization - not needed, the field is a boolean
@@ -693,6 +698,7 @@ def field(
693
698
envvar : Optional [str ] = None ,
694
699
deprecated : Optional ['tmt.options.Deprecated' ] = None ,
695
700
help : Optional [str ] = None ,
701
+ help_example_values : Optional [list [str ]] = None ,
696
702
show_default : bool = False ,
697
703
internal : bool = False ,
698
704
# Input data normalization
@@ -719,6 +725,7 @@ def field(
719
725
envvar : Optional [str ] = None ,
720
726
deprecated : Optional ['tmt.options.Deprecated' ] = None ,
721
727
help : Optional [str ] = None ,
728
+ help_example_values : Optional [list [str ]] = None ,
722
729
show_default : bool = False ,
723
730
internal : bool = False ,
724
731
# Input data normalization
@@ -744,6 +751,7 @@ def field(
744
751
envvar : Optional [str ] = None ,
745
752
deprecated : Optional ['tmt.options.Deprecated' ] = None ,
746
753
help : Optional [str ] = None ,
754
+ help_example_values : Optional [list [str ]] = None ,
747
755
show_default : bool = False ,
748
756
internal : bool = False ,
749
757
# Input data normalization
@@ -770,6 +778,7 @@ def field(
770
778
envvar : Optional [str ] = None ,
771
779
deprecated : Optional ['tmt.options.Deprecated' ] = None ,
772
780
help : Optional [str ] = None ,
781
+ help_example_values : Optional [list [str ]] = None ,
773
782
show_default : bool = False ,
774
783
internal : bool = False ,
775
784
# Input data normalization
@@ -813,6 +822,8 @@ def field(
813
822
:param help: the help string for the command-line option. Multiline strings
814
823
can be used, :py:func:`textwrap.dedent` is applied before passing
815
824
``help`` to :py:func:`click.option`.
825
+ :param help_example_values: Specific values that should be shown in
826
+ the documentation as interesting examples of the field usage.
816
827
:param show_default: show default value
817
828
Passed directly to :py:func:`click.option`.
818
829
:param internal: if set, the field is treated as internal-only, and will not
@@ -854,6 +865,7 @@ def field(
854
865
'tmt' : FieldMetadata (
855
866
internal = internal ,
856
867
help = textwrap .dedent (help ).strip () if help else None ,
868
+ help_example_values = help_example_values or [],
857
869
_metavar = metavar ,
858
870
default = default ,
859
871
default_factory = default_factory ,
0 commit comments