2024年5月5日(日) 18:56 Matheus Afonso Martins Moreira <matheus.a.m.more...@gmail.com>: > The PATH variable is hard coded in the user command finder function. > Transforming it into an argument allows reusing the file finding logic > with variables other than PATH, making the code more flexible.
There is already a very similar feature of the `command' builtin, which enforces PATH to be a specific path in searching the command yet doesn't replace the actual value of PATH for the executed command. This is implemented by the flag `#define CMDSRCH_STDPATH 0x02' (findcmd.h:28 @ master). For consistency, shouldn't the suggested feature to change the search path for the script files be implemented by a similar flag CMDSRCH_XXX? This is sufficient because the suggested new parameter `path_var' only becomes PATH or BASH_LIBRARIES_PATH for now. I wouldn't expect a YAGNI argument about the future possibility.