bashmarks icon indicating copy to clipboard operation
bashmarks copied to clipboard

Improved behaviour in global env

Open radhikalism opened this issue 14 years ago • 0 comments

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_help and exit_message are particularly unpleasant. I have prefixed private functions with _bashmarks_; public functions (called by external programs like complete/compctl) with bashmarks_; 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 using kill too.

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! :-)

radhikalism avatar Mar 04 '11 05:03 radhikalism