diff options
-rw-r--r-- | fietsboek/updater/cli.py | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/fietsboek/updater/cli.py b/fietsboek/updater/cli.py index 2a7fc14..f00dfde 100644 --- a/fietsboek/updater/cli.py +++ b/fietsboek/updater/cli.py @@ -159,6 +159,29 @@ def revision(config, revision_id): click.echo(f"Revision saved to {filename}") +@cli.command("status") +@config_option +def status(config): + """Display information about the current version and available updates.""" + updater = Updater(config) + updater.load() + current = updater.current_versions() + heads = updater.heads() + click.secho("Current versions:", fg="yellow") + if current: + for i in current: + click.echo(i) + else: + click.secho("No current version", fg="red") + click.secho("Available updates:", fg="yellow") + updates = set(heads) - set(current) + if updates: + for i in updates: + click.echo(i) + else: + click.secho("All updates applied!", fg="green") + + @cli.command("help", hidden=True) @click.pass_context @click.argument("subcommand", required=False) |