diff --git a/src/git_flow/command/branch.py b/src/git_flow/command/branch.py index c5f72c1..f987bdf 100644 --- a/src/git_flow/command/branch.py +++ b/src/git_flow/command/branch.py @@ -18,7 +18,13 @@ class BranchCommand(Command): parser.add_argument( "environment", nargs="?", - help="Entorno de las ramas a listar. Puede ser vacio para listar ramas de todos los entornos, un entorno válido, o 'trash' para listar las ramas eliminadas.", + help="Entorno de las ramas a listar. Por defecto, es el entorno actual.", + ) + + parser.add_argument( + "--trash", + action="store_true", + help="Listar ramas en la 'papelera de reciclaje' (ramas que empiezan con 'trash/')" ) return parser @@ -29,14 +35,14 @@ class BranchCommand(Command): self.current_branch = Git.get_current_branch() self.environments = self.flowconfig["flow.branches"].split(",") + if args.trash: + self.show_trash_branches() if args.environment is None: self.show_envs() self.show_all_branches() elif args.environment in self.environments: self.show_envs() self.show_env_branches(args.environment) - elif args.environment == "trash": - self.show_trash_branches() else: raise GitFlowError(f"'{args.environment}' no es un entorno válido.")