-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
utility: Detect GNU 'ls' before applying the relevant tweaks
Detect `ls` provided by GNU Core Utilities upfront before applying the relevant settings and aliases. The revised logic takes the following aspects into consideration: - `is-callable 'dircolors'` is not a sufficient test for verifying if the `ls` in scope is _also_ provided by GNU Core Utilities. `ls` can continue to be the one provided by BSD Core Utilities because of its precedence in `$path`. - The `ls` in scope anyway can be either GNU Utils provided or BSD Utils provided depending on either `$path` precedence, soft link (via `ln -s`), or wrapper function (via 'gnu-utility' module). - So instead of '_guessing_' the possible one, just detect if it is from GNU Utils and apply the relevant settings and aliases. - Note that GNU prefixed `ls` (`gls`) is intentionally not honored in this case to avoid possible conflict/shadowing with other `gls` callable (can happen if 'git' module is used, for example). Besides, honoring `gls` would imply we honor other commands (like `mv`, `rm` etc.) to be consistent. We have a module 'gnu-utils' dedicated for that after all.
- Loading branch information
Showing
2 changed files
with
27 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters