bashmarks
bashmarks copied to clipboard
Improved behaviour in global env
Hi Huy,
I've committed three changes to my fork of bashmarks, all related to how it operates in the global interactive shell environment:
- When the mktemp invocation fails (as in the recent GNU/BSD compatibility bug) the entire shell would exit; now it acts conditionally based on the return code of the mktemp call instead of calling exit.
- Various function and variable names were in the global namespace —
check_helpandexit_messageare particularly unpleasant. I have prefixed private functions with_bashmarks_; public functions (called by external programs like complete/compctl) withbashmarks_; and left user-interactive functions as they are. - The control flow concerning the help check was troubling because it relied on
kill SIGINT, and also implemented each interactive command's behaviour under the abbreviated function name. I think it would be neater to abstract out the implementation, and thus avoid usingkilltoo.
Let me know what you think, or feel free to apply any or all of the above. Thanks for the great utility, by the way! :-)