bd
bd copied to clipboard
Clean Up Functions After Completion
One of the intended methods of usage for bd
is to source it, executing it in the current shell.
Doing so leaves the functions usage_error()
, help_msg()
, and newpwd()
defined, however, which may be undesirable.
This PR prefixes all function names with _bd_
(example: usage_error()
becomes _bd_usage_error()
) so that they are less likely to override anything important.
It also calls unset -f
to remove the function definitions at the end of execution so that the functions do not remain defined if bd
is sourced.