diff --git a/README.md b/README.md index 80c6486..bf0e71d 100644 --- a/README.md +++ b/README.md @@ -69,7 +69,7 @@ más información): - `merge`: Mergea la rama actual a una de las ramas principales. - `tag`: Crea un tag sobre el ultimo merge siguiendo SemVer (ver [Tag](#tag)). - `release`: Prepara la rama actual para pasarse al siguiente entorno configurado. -- `branch`: Lista las ramas del repositorio, agrupadas por entorno objetivo. +- `branch ls`: Lista las ramas del repositorio, agrupadas por entorno objetivo. El workflow para el cual se penso la herramienta es el siguiente: @@ -88,7 +88,7 @@ El workflow para el cual se penso la herramienta es el siguiente: `feature/my-new-feature`, se crea la rama `release/test/feature/my-new-feature` sobre `test` que tiene los cambios de la rama original. -En cualquier momento se puede usar `git-flow branch` para ver en qué entorno está cada rama, y cuáles +En cualquier momento se puede usar `git-flow branch ls` para ver en qué entorno está cada rama, y cuáles están todavía en progreso (`wip/`) o descartadas (`trash/`). ### Tag diff --git a/src/git_flow/command/branch/__init__.py b/src/git_flow/command/branch/__init__.py new file mode 100644 index 0000000..219afcf --- /dev/null +++ b/src/git_flow/command/branch/__init__.py @@ -0,0 +1,6 @@ +import typer + +from git_flow.command.branch import ls + +app = typer.Typer(name="branch") +app.add_typer(ls.app) diff --git a/src/git_flow/command/branch.py b/src/git_flow/command/branch/ls.py similarity index 98% rename from src/git_flow/command/branch.py rename to src/git_flow/command/branch/ls.py index 1c78dc3..4b07696 100644 --- a/src/git_flow/command/branch.py +++ b/src/git_flow/command/branch/ls.py @@ -3,12 +3,12 @@ from typing import Annotated import typer from rich.console import Console -import git_flow.command.base as base from git_flow import ( TRASH_BRANCH_PREFIX, WIP_BRANCH_PREFIX, GitFlowError, ) +from git_flow.command import base from git_flow.git import Git BRANCH_FORMAT = "%(refname:short)" @@ -18,7 +18,7 @@ console = Console() @app.command() -def branch( +def ls( environment: Annotated[ str | None, typer.Argument(