Skip to content

Put argparse.bash on $PATH, not with scripts.#20

Open
fovea1959 wants to merge 1 commit into
nhoffman:masterfrom
fovea1959:on-path
Open

Put argparse.bash on $PATH, not with scripts.#20
fovea1959 wants to merge 1 commit into
nhoffman:masterfrom
fovea1959:on-path

Conversation

@fovea1959

Copy link
Copy Markdown

Resolves issue #19.

@nhoffman

Copy link
Copy Markdown
Owner

Hi @fovea1959 - thanks for the suggestion (also TIL that source will find files on your PATH). I like the idea but I'd also like to retain the existing behavior: I believe that with this change argparse.bash would no longer be found when it is (only) in the same directory as the script. Can you suggest a change that retains this behavior?

@fovea1959

fovea1959 commented Jun 21, 2026

Copy link
Copy Markdown
Author

I cannot suggest such a change (symlinks and lack of brevity are two reasons), but offer that it may not be necessary.

People already counting on that behaviour have user scripts saying source $(dirname $0)/argparse.bash, and those won't break, unless they remove the 'not-on-the-path' argparse.bash next to the user script and do not change their user scripts. And that will only break IF the user script using argparse.bash is not on the path, but was invoked because the user script was symlinked onto the path or invoked by full path.

Offsetting the backwards compatibility issue, making this change will simplify the job for people that use it in multiple places. Updated version? Update once, not in x places.

Perhaps the options are:

  • make the change with loud documentation about 'if you are using this change and are counting on it being on the path, you need to check your existing scripts'.
  • leave the code as is, but update the documentation with a 'if you only want to install this in one place, you can do it, just need to remove the $(dirname $0)/ from your user script(s).

I prefer the 1st, but I think the 2nd is palatable?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants