Skip to content
Merged
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
14 changes: 14 additions & 0 deletions commands/self/find-cmd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,20 @@ source "${CLI_DIR}/core/helpers.sh"
parse_help "$@"
declare command subcommand

echo_gray "Finding commands that match the following filters..."

if [[ -n "$command" ]]; then
echo_gray "- Command regex: $command"
else
echo_gray "- Command regex: none (all commands)"
fi

if [[ -n "$subcommand" ]]; then
echo_gray "- Subcommand regex: $subcommand"
else
echo_gray "- Subcommand regex: none (all subcommands)"
fi

commands="$(
find "${CLI_DIR}/commands" -mindepth 2 -maxdepth 2 -type f -name '*.sh' | while read -r command_file; do
cmd_subcommand=$(echo "$command_file" | awk -F/ '{print $(NF-1) " " $NF}' | sed 's/\.sh$//')
Expand Down
Loading