Commit 7df3379d authored by David Huss's avatar David Huss 💬
Browse files

Add colors to help

parent e8cf9ac2
__version__ = '0.1.27' __version__ = '0.1.28'
...@@ -6,6 +6,7 @@ import json ...@@ -6,6 +6,7 @@ import json
import click import click
import toml import toml
from pathlib import Path from pathlib import Path
from click_help_colors import HelpColorsGroup
# Local module imports # Local module imports
...@@ -31,7 +32,7 @@ def get_version(): ...@@ -31,7 +32,7 @@ def get_version():
class AliasedGroup(click.Group): class AliasedGroup(HelpColorsGroup):
""" """
Subclass of Group to allow abbreviating commands like this: Subclass of Group to allow abbreviating commands like this:
Instead of `bbbmon meetings` one could type `bbbmon m` Instead of `bbbmon meetings` one could type `bbbmon m`
...@@ -49,7 +50,9 @@ class AliasedGroup(click.Group): ...@@ -49,7 +50,9 @@ class AliasedGroup(click.Group):
ctx.fail('Too many matches: %s' % ', '.join(sorted(matches))) ctx.fail('Too many matches: %s' % ', '.join(sorted(matches)))
@click.group(context_settings=CONTEXT_SETTINGS, cls=AliasedGroup, invoke_without_command=True) @click.group(context_settings=CONTEXT_SETTINGS, cls=AliasedGroup, invoke_without_command=True,
help_headers_color='yellow',
help_options_color='green')
@click.option('--userconfig', '-u', is_flag=True, help="Use user config even if on server") @click.option('--userconfig', '-u', is_flag=True, help="Use user config even if on server")
@click.option('--watch', '-w', help="Run repeatedly with the given interval in seconds", type=click.IntRange(2, 2147483647, clamp=True)) @click.option('--watch', '-w', help="Run repeatedly with the given interval in seconds", type=click.IntRange(2, 2147483647, clamp=True))
@click.option('--version', '-V', is_flag=True, help="Show version") @click.option('--version', '-V', is_flag=True, help="Show version")
......
...@@ -45,6 +45,20 @@ optional = false ...@@ -45,6 +45,20 @@ optional = false
python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*"
version = "7.1.2" version = "7.1.2"
[[package]]
category = "main"
description = "Colorization of help messages in Click"
name = "click-help-colors"
optional = false
python-versions = "*"
version = "0.8"
[package.dependencies]
click = ">=7.0"
[package.extras]
dev = ["pytest"]
[[package]] [[package]]
category = "dev" category = "dev"
description = "Cross-platform colored terminal text." description = "Cross-platform colored terminal text."
...@@ -241,7 +255,7 @@ docs = ["sphinx", "jaraco.packaging (>=3.2)", "rst.linker (>=1.9)"] ...@@ -241,7 +255,7 @@ docs = ["sphinx", "jaraco.packaging (>=3.2)", "rst.linker (>=1.9)"]
testing = ["pathlib2", "unittest2", "jaraco.itertools", "func-timeout"] testing = ["pathlib2", "unittest2", "jaraco.itertools", "func-timeout"]
[metadata] [metadata]
content-hash = "a83b9881a3285865e8351a75e707e006ec523a3604788c35f40448b1c5a75e1e" content-hash = "8ee24b117e29b83f8fad8dd042da05414fa75b30da90c66c39c5b290a88bd6d7"
python-versions = "^3.5" python-versions = "^3.5"
[metadata.files] [metadata.files]
...@@ -265,6 +279,10 @@ click = [ ...@@ -265,6 +279,10 @@ click = [
{file = "click-7.1.2-py2.py3-none-any.whl", hash = "sha256:dacca89f4bfadd5de3d7489b7c8a566eee0d3676333fbb50030263894c38c0dc"}, {file = "click-7.1.2-py2.py3-none-any.whl", hash = "sha256:dacca89f4bfadd5de3d7489b7c8a566eee0d3676333fbb50030263894c38c0dc"},
{file = "click-7.1.2.tar.gz", hash = "sha256:d2b5255c7c6349bc1bd1e59e08cd12acbbd63ce649f2588755783aa94dfb6b1a"}, {file = "click-7.1.2.tar.gz", hash = "sha256:d2b5255c7c6349bc1bd1e59e08cd12acbbd63ce649f2588755783aa94dfb6b1a"},
] ]
click-help-colors = [
{file = "click-help-colors-0.8.tar.gz", hash = "sha256:119e5faf69cfc919c995c5962326ac8fd87f11e56a371af594e3dfd8458f4c6e"},
{file = "click_help_colors-0.8-py3-none-any.whl", hash = "sha256:0d841a4058ec88c47f93ff6f32547a055f8e0a0273f6bd6cb3e08430f195131d"},
]
colorama = [ colorama = [
{file = "colorama-0.4.3-py2.py3-none-any.whl", hash = "sha256:7d73d2a99753107a36ac6b455ee49046802e59d9d076ef8e47b61499fa29afff"}, {file = "colorama-0.4.3-py2.py3-none-any.whl", hash = "sha256:7d73d2a99753107a36ac6b455ee49046802e59d9d076ef8e47b61499fa29afff"},
{file = "colorama-0.4.3.tar.gz", hash = "sha256:e96da0d330793e2cb9485e9ddfd918d456036c7149416295932478192f4436a1"}, {file = "colorama-0.4.3.tar.gz", hash = "sha256:e96da0d330793e2cb9485e9ddfd918d456036c7149416295932478192f4436a1"},
......
[tool.poetry] [tool.poetry]
name = "bbbmon" name = "bbbmon"
version = "0.1.27" version = "0.1.28"
description = "A small CLI utility to monitor bbb usage" description = "A small CLI utility to monitor bbb usage"
authors = ["David Huss <david.huss@hfbk-hamburg.de>"] authors = ["David Huss <david.huss@hfbk-hamburg.de>"]
maintainers = ["David Huss <david.huss@hfbk-hamburg.de>"] maintainers = ["David Huss <david.huss@hfbk-hamburg.de>"]
...@@ -24,6 +24,7 @@ python = "^3.5" ...@@ -24,6 +24,7 @@ python = "^3.5"
requests = "^2.23.0" requests = "^2.23.0"
click = "^7.1.2" click = "^7.1.2"
toml = "^0.10.1" toml = "^0.10.1"
click-help-colors = "^0.8"
[tool.poetry.dev-dependencies] [tool.poetry.dev-dependencies]
pytest = "^5.2" pytest = "^5.2"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment