File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed
Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -670,15 +670,20 @@ def main() -> None:
670670
671671 options = parser .parse_args ()
672672
673+ if sys .platform == "win32" :
674+ import colorama
675+ colorama .init (strip = options .color )
676+
673677 if options .platform is None :
674678 platform_env = os .environ .get ('TLDR_PLATFORM' , '' ).strip ().lower ()
675679 if platform_env in OS_DIRECTORIES :
676680 options .platform = [platform_env ]
677681 elif platform_env :
678- print (
679- f"Warning: '{ platform_env } ' is not a supported TLDR_PLATFORM env value."
682+ warning_msg = (
683+ f"Warning: '{ platform_env } ' is not a supported TLDR_PLATFORM environment value."
680684 "\n Falling back to auto-detection."
681685 )
686+ print (colored (warning_msg , 'yellow' ))
682687
683688 display_option_length = "long"
684689 if os .environ .get ('TLDR_OPTIONS' ) == "short" :
@@ -694,10 +699,6 @@ def main() -> None:
694699 if options .short_options and options .long_options :
695700 display_option_length = "both"
696701
697- if sys .platform == "win32" :
698- import colorama
699- colorama .init (strip = options .color )
700-
701702 if options .color is False :
702703 os .environ ["FORCE_COLOR" ] = "true"
703704
You can’t perform that action at this time.
0 commit comments