adr-tools
adr-tools copied to clipboard
Change in 2.2.0 to use of "-more" in help does not work in Git Bash
ad-help changed in 2.2.0 to use PAGER:-more which results in more command not available error when using Git Bash on Windows. Prior to this it did work.
Example output:
$ adr
/usr/bin/adr-help: line 16: more: command not found
Hi @dburriss, "more" is the default pager for the help output. From reading around, git bash on windows doesnt have more installed by default but does have less installed by default.
You can set the default pager to be used by setting the environment variable to ADR_PAGER.
putting export ADR_PAGER=less into your .bash_profile should fix the issue.
Hope that helps :)
more is defined by the POSIX standard, and less is not. It’s not practical to support non-standard environments.
How about if the pager does not exist it falls back to no pager, and it’s up to the user to pipe it through whatever pager exists in their environment?
For now, I've updated the installation instruction for Git for Windows
For now, I've updated the installation instruction for Git for Windows
This last step could be made (much) clearer ;)
For what it's worth, I found it easier to just edit adr-help locally
from: pager="${ADR_PAGER:-${PAGER:-more}}"
to: pager="${ADR_PAGER:-${PAGER:-less}}"
This worked really well using a fresh install of git for windows 2.20.1
Since 'less' is not POSIX compliant, and 'more' is not available in Git Bash, this might be a better workaround:
from: pager="${ADR_PAGER:-${PAGER:-more}}"
to: pager="${ADR_PAGER:-${PAGER:-cat}}"
If the user wants paging, he/she should define PAGER.