refactor: cambio opcion para listar ramas trash
This commit is contained in:
@@ -18,7 +18,13 @@ class BranchCommand(Command):
|
|||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
"environment",
|
"environment",
|
||||||
nargs="?",
|
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
|
return parser
|
||||||
@@ -29,14 +35,14 @@ class BranchCommand(Command):
|
|||||||
self.current_branch = Git.get_current_branch()
|
self.current_branch = Git.get_current_branch()
|
||||||
self.environments = self.flowconfig["flow.branches"].split(",")
|
self.environments = self.flowconfig["flow.branches"].split(",")
|
||||||
|
|
||||||
|
if args.trash:
|
||||||
|
self.show_trash_branches()
|
||||||
if args.environment is None:
|
if args.environment is None:
|
||||||
self.show_envs()
|
self.show_envs()
|
||||||
self.show_all_branches()
|
self.show_all_branches()
|
||||||
elif args.environment in self.environments:
|
elif args.environment in self.environments:
|
||||||
self.show_envs()
|
self.show_envs()
|
||||||
self.show_env_branches(args.environment)
|
self.show_env_branches(args.environment)
|
||||||
elif args.environment == "trash":
|
|
||||||
self.show_trash_branches()
|
|
||||||
else:
|
else:
|
||||||
raise GitFlowError(f"'{args.environment}' no es un entorno válido.")
|
raise GitFlowError(f"'{args.environment}' no es un entorno válido.")
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user