diff --git a/README.rst b/README.rst index 294e48b76..2de8fd19e 100644 --- a/README.rst +++ b/README.rst @@ -119,6 +119,7 @@ Notes - An Alfred Workflow for howdoi can be found at `http://blog.gleitzman.com/post/48539944559/howdoi-alfred-even-more-instant-answers `_. - Howdoi uses a cache for faster access to previous questions. Caching functionality can be disabled by setting the HOWDOI_DISABLE_CACHE environment variable. The cache is stored in `~/.cache/howdoi`. - You can set the HOWDOI_URL environment variable to change the source url for answers (default: stackoverflow.com). Other options include `serverfault.com` or `pt.stackoverflow.com`. Here's the `full list `_. +- Setting the HOWDOI_COLORIZE environment variable will colorize the output by default. - Special thanks to Rich Jones (`@miserlou `_) for the idea. Development diff --git a/howdoi/howdoi.py b/howdoi/howdoi.py index 2af1c55ef..f011bbdd1 100755 --- a/howdoi/howdoi.py +++ b/howdoi/howdoi.py @@ -250,6 +250,9 @@ def command_line_runner(): if not os.getenv('HOWDOI_DISABLE_CACHE'): enable_cache() + if os.getenv('HOWDOI_COLORIZE'): + args['color'] = True + if sys.version < '3': print(howdoi(args).encode('utf-8', 'ignore')) else: