[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 2/9] findcmd: parameterize path variable in functions
From: |
Koichi Murase |
Subject: |
Re: [PATCH 2/9] findcmd: parameterize path variable in functions |
Date: |
Tue, 7 May 2024 19:35:04 +0900 |
2024年5月5日(日) 18:56 Matheus Afonso Martins Moreira
<matheus.a.m.moreira@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.
[PATCH 3/9] findcmd: define the user library finder function, Matheus Afonso Martins Moreira, 2024/05/05
[PATCH 4/9] bashgetopt: define long option shortener function, Matheus Afonso Martins Moreira, 2024/05/05
Re: [PATCH 4/9] bashgetopt: define long option shortener function, Chet Ramey, 2024/05/08