From 2e38ecc984bbe7897d3a11a9d6ddb1a376843466 Mon Sep 17 00:00:00 2001 From: atoav <dh@atoav.com> Date: Thu, 30 Apr 2020 15:23:09 +0200 Subject: [PATCH] Make watch a default option --- bbbmon/bbbmon.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/bbbmon/bbbmon.py b/bbbmon/bbbmon.py index 4124292..ac2f98b 100755 --- a/bbbmon/bbbmon.py +++ b/bbbmon/bbbmon.py @@ -39,7 +39,8 @@ class AliasedGroup(click.Group): @click.group(context_settings=CONTEXT_SETTINGS, cls=AliasedGroup) @click.option('--userconfig', '-u', is_flag=True, help="Use user config even if on server") -def main(userconfig): +@click.option('--watch', '-w', help="Run repeatedly with the given interval in seconds", type=click.IntRange(2, 2147483647, clamp=True)) +def main(userconfig, watch): """BBBMON is a small CLI utility to monitor bbb usage \b @@ -68,7 +69,7 @@ def main(userconfig): @click.option('--twolines', '-2', is_flag=True, help="Print essentials on two lines") @click.option('--all', '-a', 'all_', is_flag=True, help="Print all") @click.option('--fancy/--no-fancy', default=True, show_default=True, help="Use fancy headers") -def meetings(ctx, userconfig, short, compact, n, all_, twolines, leaderboards, participants, presenter, watch, presenter_id, meetings, endpoint, fancy): +def meetings(ctx, userconfig, watch, short, compact, n, all_, twolines, leaderboards, participants, presenter, presenter_id, meetings, endpoint, fancy): """View currently active meetings""" if short: leaderboards = False @@ -110,7 +111,7 @@ def meetings(ctx, userconfig, short, compact, n, all_, twolines, leaderboards, p @click.option('--edit', is_flag=True, help="Open the config in the default editor") @click.option('--print', 'print_', is_flag=True, help="Print the config to stdout") @click.option('--path', is_flag=True, help="Print the path to the config") -def config(ctx, userconfig, new, edit, path, print_): +def config(ctx, userconfig, watch, new, edit, path, print_): """Print, show or edit the config""" user_config_path = get_user_config_path() -- GitLab