diff --git a/README.md b/README.md index 5eef0e2..9bfb581 100644 --- a/README.md +++ b/README.md @@ -18,6 +18,8 @@ There are three ways to get `httpstat`: - Through homebrew (macOS only): `brew install httpstat` > For Windows users, @davecheney's [Go version](https://github.com/davecheney/httpstat) is suggested. → [download link](https://github.com/davecheney/httpstat/releases) +> +> Or install through `pip install httpstat[windows]` to have better support. ## Usage diff --git a/httpstat.py b/httpstat.py index df4f396..01b8bb6 100644 --- a/httpstat.py +++ b/httpstat.py @@ -24,6 +24,16 @@ if PY3: xrange = range +WIN = os.name == 'nt' + +if WIN: + try: + import colorama + except ImportError: + print('Please install colorama for better color support in Windows') + else: + colorama.init() + # Env class is copied from https://github.com/reorx/getenv/blob/master/getenv.py class Env(object): diff --git a/setup.py b/setup.py index fc5a556..189d76c 100644 --- a/setup.py +++ b/setup.py @@ -39,5 +39,8 @@ def get_long_description(): 'httpstat = httpstat:main' ] }, + extras_require={ + 'windows': ['colorama'], + }, license='License :: OSI Approved :: MIT License', )