Skip to content

Commit ce3f323

Browse files
anthony-chudrewbrokke
authored andcommitted
LPD-69624 Make command public
1 parent 0b83483 commit ce3f323

File tree

1 file changed

+28
-28
lines changed

1 file changed

+28
-28
lines changed

scripts/cli/lec.sh

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -625,34 +625,6 @@ _cmd_gw() {
625625
./gradlew "${@}"
626626
)
627627
}
628-
_cmd_list() {
629-
local closest_entity
630-
local entity="${1}"
631-
632-
if [[ -z "${entity}" ]]; then
633-
_print_step "Showing listable entities..."
634-
635-
_listPrefixedFunctions _list_
636-
637-
exit
638-
fi
639-
640-
if ! _verifyListableEntity "${entity}"; then
641-
closest_entity=$(_listPrefixedFunctions _list_| _fzf --filter "${entity}" | head -n 1)
642-
643-
if _verifyListableEntity "${closest_entity}" && _confirm "Entity \"${entity}\" is unknown. Use closest entity \"${closest_entity}\" instead?"; then
644-
entity=${closest_entity}
645-
else
646-
_print_error "Cannot list ${C_YELLOW}${entity}${C_NC}. Showing listable entities..."
647-
648-
_listPrefixedFunctions _list_
649-
650-
exit
651-
fi
652-
fi
653-
654-
_list_"${entity}"
655-
}
656628
_cmd_ports() {
657629
_checkProjectDirectory
658630

@@ -835,6 +807,34 @@ cmd_init() {
835807
_startProject "${worktree_dir}"
836808
fi
837809
}
810+
cmd_list() {
811+
local closest_entity
812+
local entity="${1}"
813+
814+
if [[ -z "${entity}" ]]; then
815+
_print_step "Showing listable entities..."
816+
817+
_listPrefixedFunctions _list_
818+
819+
exit
820+
fi
821+
822+
if ! _verifyListableEntity "${entity}"; then
823+
closest_entity=$(_listPrefixedFunctions _list_| _fzf --filter "${entity}" | head -n 1)
824+
825+
if _verifyListableEntity "${closest_entity}" && _confirm "Entity \"${entity}\" is unknown. Use closest entity \"${closest_entity}\" instead?"; then
826+
entity=${closest_entity}
827+
else
828+
_print_error "Cannot list ${C_YELLOW}${entity}${C_NC}. Showing listable entities..."
829+
830+
_listPrefixedFunctions _list_
831+
832+
exit
833+
fi
834+
fi
835+
836+
_list_"${entity}"
837+
}
838838
cmd_remove() {
839839
local worktrees
840840
worktrees="$(_listWorktrees | grep -E -v "^${LIFERAY_ENVIRONMENT_COMPOSER_HOME}$" | _selectMultiple "Choose projects to remove (Tab to select multiple)")"

0 commit comments

Comments
 (0)