EOS-rankmirrors bug (--help)

Latest version of the ‘EOS-rankmirrors’ cli tool has a bug when invoking ‘–help / -h’

❯ eos-rankmirrors --help
/usr/bin/eos-rankmirrors: line 529: /bin/: Is a directory
❯ eos-rankmirrors -h
/usr/bin/eos-rankmirrors: line 529: /bin/: Is a directory

Package info

❯ pacman -Qi eos-rankmirrors
Name            : eos-rankmirrors
Version         : 25.11.3-1
Description     : EndeavourOS mirror ranking tool
Architecture    : any
URL             : https://raw.githubusercontent.com/endeavouros-team/PKGBUILDS/master/eos-rankmirrors
Licenses        : GPL3
Groups          : None
Provides        : None
Depends On      : eos-bash-shared  parallel
Optional Deps   : None
Required By     : None
Optional For    : None
Conflicts With  : None
Replaces        : None
Installed Size  : 39.06 KiB
Packager        : manuel <manuel@endeavouros.com>
Build Date      : Sun 16 Nov 2025 00:33:25 SAST
Install Date    : Thu 20 Nov 2025 13:32:46 SAST
Install Reason  : Explicitly installed
Install Script  : No
Validated By    : Signature

My .conf file doesnt show any errors on parsing but for the sake of completion.

###############################################
# eos-rankmirrors.conf
# A configuration file for the apps of the eos-rankmirrors package.
#
# Using bash syntax.
###############################################

# EOS_OVERWRITE_MIRRORLIST determines whether the
# new EndeavourOS mirror list will automatically overwrite
# the existing list or simply be stored as a .pacnew file.
# Supported values:
#   "yes"     Overwrite the existing /etc/endeavouros-mirrorlist.
#   "no"      Save new mirror list as a .pacnew file (default).
#
EOS_OVERWRITE_MIRRORLIST='no'

# EOS_AUTO_MIRROR_RANKING is an alias to EOS_OVERWRITE_MIRRORLIST
# for backwards compatibility.
#
EOS_AUTO_MIRROR_RANKING=$EOS_OVERWRITE_MIRRORLIST    # Don't change this line!

# EOS_AUTORANK_TIMEOUT specifies the maximum time (in seconds)
# for each mirror to return the full answer.
#
EOS_AUTORANK_TIMEOUT=30

# ALWAYS_FIRST_EOS_MIRRORS pre-determines the preferred mirrors in the ranking result.
# It contains a simple list of (partial) mirror names separated by pipe (|) characters.
# Note: regular expressions are not supported.
# Tip: use single quotes ('') around the string of mirror(s).
# Examples:
#   ALWAYS_FIRST_EOS_MIRRORS='moson|de.freedif|funami'                                # several partial URLs
#   ALWAYS_FIRST_EOS_MIRRORS='https://mirror.moson.org/endeavouros/repo/$repo/$arch'  # one full URL
#   ALWAYS_FIRST_EOS_MIRRORS='Server=file:///home/custompkgs/$repo'                   # how to add a local repo
# Note: if
#    a) option     --prefer
#    b) variable   ALWAYS_FIRST_EOS_MIRRORS
# are both used, option takes precedence.
#
ALWAYS_FIRST_EOS_MIRRORS=''

# EOS_IGNORED_MIRRORS is an *array* of (partial) mirror names and does the same as option --ignore.
# If both EOS_IGNORED_MIRRORS and --ignore are used, they both matter.
#
EOS_IGNORED_MIRRORS=()

# EOS_RANKMIRRORS_EXIT_CODE_VERBOSITY specifies how much information will be shown when
# a mirror fails to rank. Supported values:
#     all     All available information, including curl error code and reason in plain text.
#     code    Less than above, including curl error code.
#     show    Less than above, no curl error info.
#     none    Nothing.
# Default is "show".
#
EOS_RANKMIRRORS_EXIT_CODE_VERBOSITY=show

# EOS_RANK_WHEN_MIRRORLIST_CHANGES specifies whether to automatically run eos-rankmirrors
# when package 'endeavouos-mirrorlist' gets an update.
# Supported values:
#    yes       (default for backwards compatibility)
#    no
#
EOS_RANK_WHEN_MIRRORLIST_CHANGES=yes

# EOS_KEEP_UNRANKED_LIST_BY_HOOK is used when the following two conditions hold:
#   - package endeavouros-mirrorlist is just installed or updated
#   - if EOS_RANK_WHEN_MIRRORLIST_CHANGES is set to "no"
# File /etc/pacman.d/endeavouros-mirrorlist.pacnew will be deleted if
# EOS_KEEP_UNRANKED_LIST_BY_HOOK is set to 'no'
# (since it has not been ranked and likely is not optimal for the user).
# Supported values:
#    yes
#    no   (default)
#
EOS_KEEP_UNRANKED_LIST_BY_HOOK=no

# EOS_SHOW_ORIGINAL_MIRRORLIST determines whether to include the original unranked
# list of mirrors to the end of the ranked file.
# Supported values:
#    yes  (default)
#    no
#
EOS_SHOW_ORIGINAL_MIRRORLIST=yes

# EOS_RANKMIRRORS_PAGER is the pager for eos-rankmirrors (see option --pager).
# Note that it may include options too, e.g. "less -RF".
# If not set, the $PAGER or other installed pager apps are used.
#
EOS_RANKMIRRORS_PAGER=""

# CMD_OPTIONS can contain your default command line options.
# If the list is empty (i.e. no options), the app defaults will be used.
#
CMD_OPTIONS=(
  --parallel
  --timeout=20
  --verbose
  --sort=rate
  # --prefer=''
  # --ignore=''
)

Finally the only real way to determine where the bug is.

bash -x /usr/bin/eos-rankmirrors --help --verbose
 source /etc/eos-color.conf
++ RED=$'\E[1;91m'
++ GREEN=$'\E[1;92m'
++ YELLOW=$'\E[1;93m'
++ BLUE=$'\E[1;94m'
++ MAGENTA=$'\E[1;95m'
++ CYAN=$'\E[1;96m'
++ RESET=$'\E[0m'
+ Main0 --verbose --help
+ LANG=C
+ Main --verbose --help
+ local -r SHORT_OPTIONS=abhnpst:
+ local -r LONG_OPTIONS_INTERNAL=dump-options::,hook-rank,list-only,mirror-add:,internal-testing,debug
+ local LONG_OPTIONS=verbose,help,no-save,test-all,timeout:,sort:,ignore:,prefer:,mirror-verbosity:
+ LONG_OPTIONS+=,use-local-mirrorlist,show-rank-info:,show-orig-list:,colors:,parallel,sequential
+ LONG_OPTIONS+=,pager,pager-nano,pager-less,edit-config
+ local -r progname=eos-rankmirrors
+ source /usr/share/endeavouros/scripts/eos-script-lib-yad --limit-icons
++ source /etc/eos-color.conf
+++ RED=$'\E[1;91m'
+++ GREEN=$'\E[1;92m'
+++ YELLOW=$'\E[1;93m'
+++ BLUE=$'\E[1;94m'
+++ MAGENTA=$'\E[1;95m'
+++ CYAN=$'\E[1;96m'
+++ RESET=$'\E[0m'
++ source /etc/eos-script-lib-yad.conf
+++ export EOS_ROOTER=su
+++ EOS_ROOTER=su
+++ EOS_WELCOME_CONNECTION_WARNING=yes
+++ EOS_CONNECTION_CHECKER=curl
+++ EOS_WIFIDEV_CHECK=yes
+++ EOS_AUR_HELPER=yay
+++ EOS_AUR_HELPER_OTHER=
+++ EOS_WELCOME_PACDIFFERS=(meld kdiff3 kompare diffuse diff "vim -d")
+++ EOS_PACDIFF_WARNING=yes
+++ EOS_UPDATE_PACDIFFER=
+++ EOS_SUDO_EDITORS=(rnano nano vim "emacs -nw")
+++ EOS_WALLPAPER_FETCHER=git
+++ EOS_WELCOME_HAS_SEE_YOU_LATER_BUTTON=no
+++ EOS_FILESERVER_SITE=gitlab
+++ SyncAfterUpdate=no
+++ EOS_UPDATE_ARCH_KEYRING_FIRST=no
+++ EOS_ICON_SETS_PREFERENCE=(/usr/share/icons/*)
+++ EOS_PREFERRED_BROWSERS=(xdg-open exo-open kde-open firefox chromium vivaldi-stable opera)
+++ RATE_MIRRORS_MAX_DELAY_ARCH=3600
+++ '[' -z '' ']'
+++ WELCOME_RAMI_OPTIONS=--save
+++ WELCOME_RAMI_OPTIONS+=' --timeout-rank 10'
+++ WELCOME_RAMI_OPTIONS+=' --ranking-data --continent -cDE,US'
+++ WELCOME_RAMI_OPTIONS+=' -i acadielinux,k0.ae,lyrahosting,jtremesay,ungleich,sox.rs,urbanwave'
+++ EOS_LOCATION_PROVIDER_URL=https://ipinfo.io
+++ EOS_REBOOT_RECOMMENDING=yes
+++ EOS_YAD_MISSING_NOTIFICATION=yes
++ export EOS_WICON=/usr/share/endeavouros/EndeavourOS-icon.png
++ EOS_WICON=/usr/share/endeavouros/EndeavourOS-icon.png
++ export 'EOS_YAD_STARTER_CMD=/usr/bin/yad --window-icon=/usr/share/endeavouros/EndeavourOS-icon.png'
++ EOS_YAD_STARTER_CMD='/usr/bin/yad --window-icon=/usr/share/endeavouros/EndeavourOS-icon.png'
++ translations_dir=/usr/share/endeavouros/scripts
++ source /usr/share/endeavouros/scripts/translations.bash
+++ tr_indexes=()
+++ declare -A tr_strings
++ false
++ eos_is_installing
++ '[' renier = liveuser ']'
++ '[' renier = liveuser ']'
++ return 1
++ case "$EOS_ROOTER" in
++ export EOS_ROOTER=eos-run-cmd-with-su
++ EOS_ROOTER=eos-run-cmd-with-su
+ export -f eos_GetArch
+ local debugging=no
+ local use_colors=yes
+ local rankingmode=parallel
+ local -r 'less_pager=less -RF'
+ local -r 'nano_pager=nano +1 --view -'
+ local use_pager=no
++ GetPager
++ local app
++ pager_apps=('' 'less -RF' 'bat' 'most' 'more' 'cat')
++ local pager_apps
++ for app in "${pager_apps[@]}"
++ '[' -x /bin/ ']'
++ echo /bin/
++ return
+ local pager=/bin/
+ local -r sort_default=age
+ local -r timeout_default=30
+ local -r show_original_list_default=no
+ local -r show_ranking_info_default=yes
+ local -r pkgname=endeavouros-mirrorlist
+ local -r mlfolder=/etc/pacman.d
+ local eos=/etc/pacman.d/endeavouros-mirrorlist
+ local -r conf=/etc/eos-rankmirrors.conf
+ local -r emlpath=/etc/pacman.d/endeavouros-mirrorlist
+ local -r repo=endeavouros
++ eos_GetArch
++ local arch
+++ /usr/bin/uname -m
++ arch=x86_64
++ case "$arch" in
++ printf %s x86_64
+ local arch=x86_64
+ '[' x86_64 '!=' x86_64 ']'
+ local arg
+ for arg in "$@"
+ case "$arg" in
+ for arg in "$@"
+ case "$arg" in
+ Usage
+ cat
+ /bin/
/usr/bin/eos-rankmirrors: line 529: /bin/: Is a directory
+ exit 0

‘-h’ ‘–help’ and adding ‘–verbose’ doesnt change the outcome

However, when the ‘–pager-less --help’ option is set, it prints correctly.
(Order specific)

So my question is. Is this the intended behaviour? Or is it a bug. Since it does work when enough flags are given, and they are in the correct order.

The ‘–help/ -h’ flag also gets properly handled when

export pager=/usr/bin/nvim

Or any other related text editor gets exported first, however --pager/ --pager-less must be invoked first before --help, and --help cant be used on its own

Thanks for the report!
I will look at it during weekend.

BTW, can you show the contents of your PAGER variable?

I changed eos-bash-shared to version 25.11.3-1. That should fix it.
Please report what happens with it.

Edit: eos-rankmirrors still has some more to do, will be working on it during weekend.

‘pager’ is initially empty
Which is likely why

eos-rankmirrors --pager --help

has the same result as

eos-rankmirrors --help

Fixed when i export an installed text editor (removed nano)

Its likely some kind of statement fall through at the Usage function, since pager isn’t valid

Will have a look at the updated bash-shared at some point.
Thanks for the speedy reply.

eos-rankmirrors --help

Has been fixed, thank you.