File tree Expand file tree Collapse file tree 3 files changed +14
-2
lines changed Expand file tree Collapse file tree 3 files changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -48,7 +48,7 @@ classifiers = [
4848 " Topic :: Utilities" ,
4949]
5050dependencies = [
51- " colorama; sys_platform=='win32'" ,
51+ " colorama==0.4.6 ; sys_platform=='win32'" ,
5252 " shtab>=1.3.10" ,
5353 " termcolor" ,
5454]
Original file line number Diff line number Diff line change 11termcolor
2- colorama == 0.4.6
2+ colorama == 0.4.6 ; sys_platform == 'win32'
33shtab >= 1.3.10
Original file line number Diff line number Diff line change @@ -682,6 +682,7 @@ def main() -> None:
682682 display_option_length = "long"
683683 if options .short_options and options .long_options :
684684 display_option_length = "both"
685+
685686 if sys .platform == "win32" :
686687 import colorama
687688 colorama .init (strip = options .color )
@@ -744,6 +745,17 @@ def main() -> None:
744745 ).format (cmd = command ))
745746 else :
746747 output (results [0 ][0 ], display_option_length , plain = options .markdown )
748+
749+ if results [0 ][1 ] not in (get_platform (), "common" ) and not options .platform :
750+ warning_suffix = (
751+ f": showing page from platform '{ results [0 ][1 ]} ', "
752+ f"because '{ command } ' does not exist in '{ get_platform ()} ' and 'common'."
753+ )
754+ if options .markdown :
755+ print (f"warning{ warning_suffix } " )
756+ else :
757+ print (f"{ colored ('warning' , 'yellow' )} { warning_suffix } " )
758+
747759 if results [1 :]:
748760 platforms_str = [result [1 ] for result in results [1 :]]
749761 are_multiple_platforms = len (platforms_str ) > 1
You can’t perform that action at this time.
0 commit comments