Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "lazy-ecs"
version = "0.7.3"
version = "0.7.4"
description = "A CLI tool for working with AWS services"
readme = "README.md"
authors = [
Expand Down
7 changes: 7 additions & 0 deletions src/lazy_ecs/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import argparse
from importlib.metadata import PackageNotFoundError, version
from typing import TYPE_CHECKING

import boto3
Expand All @@ -15,12 +16,18 @@
from .core.app import navigate_clusters
from .ui import ECSNavigator

try:
__version__ = version("lazy-ecs")
except PackageNotFoundError:
__version__ = "dev"

console = Console()


def main() -> None:
"""Interactive AWS ECS navigation tool."""
parser = argparse.ArgumentParser(description="Interactive AWS ECS cluster navigator")
parser.add_argument("--version", action="version", version=f"lazy-ecs {__version__}")
parser.add_argument("--profile", help="AWS profile to use for authentication", type=str, default=None)
args = parser.parse_args()

Expand Down
9 changes: 9 additions & 0 deletions tests/test_cli.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import sys
from unittest.mock import Mock, patch

import pytest

from lazy_ecs import _create_aws_client, main


Expand Down Expand Up @@ -133,3 +135,10 @@ def test_create_aws_client_with_profile():
assert args[0] == "ecs"
assert "config" in kwargs
assert result == mock_client


def test_version_flag():
with patch.object(sys, "argv", ["lazy-ecs", "--version"]):
with pytest.raises(SystemExit) as exc_info:
main()
assert exc_info.value.code == 0
2 changes: 1 addition & 1 deletion uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading