diff --git a/manifester/commands.py b/manifester/commands.py index 1b66754..ff7efe0 100644 --- a/manifester/commands.py +++ b/manifester/commands.py @@ -39,4 +39,16 @@ def get_manifest(manifest_category, allocation_name): def inventory(details): """Display the local inventory file's contents.""" logger.info("Displaying local inventory data") - click.echo(helpers.load_inventory_file(Path(settings.inventory_path))) + inv = helpers.load_inventory_file(Path(settings.inventory_path)) + if not details: + click.echo("-" * 38) + click.echo(f"| {'Index'} | {'Allocation Name':<26} |") + click.echo("-" * 38) + for num, allocation in enumerate(inv): + click.echo(f"| {num:<5} | {allocation['name']:<26} |") + click.echo("-" * 38) + else: + for num, allocation in enumerate(inv): + click.echo(f"{num}:") + for key, value in allocation.items(): + click.echo(f"{'':<8}{key}: {value}")