bd icon indicating copy to clipboard operation
bd copied to clipboard

Clean Up Functions After Completion

Open ChristianSilvermoon opened this issue 2 years ago • 0 comments

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.

ChristianSilvermoon avatar May 25 '22 01:05 ChristianSilvermoon