Skip to content

feat(_comp_log): new function for debug logging #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
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
12 changes: 12 additions & 0 deletions bash_completion
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,18 @@ complete -b builtin

# start of section containing completion functions called by other functions

# Log a message to help with debugging.
# If BASH_COMPLETION_DEBUG is set, it will be printed to stderr.
# When running with `set -x`, the _comp_log call itself will be printed.
#
# @param $1 Message to log
_comp_log()
{
if [[ ${BASH_COMPLETION_DEBUG-} ]]; then
printf 'bash_completion: %s\n' "$1" >&2
fi
}

# Check if we're running on the given userland
# @param $1 userland to check for
# @since 2.12
Expand Down
Loading