💅 Tidy up ruby-build help output

This commit is contained in:
Mislav Marohnić 2023-11-07 18:10:34 +01:00
parent 91c95bbf8f
commit b80edb1889
No known key found for this signature in database
3 changed files with 31 additions and 30 deletions

View file

@ -2,27 +2,27 @@
#
# Summary: Install a Ruby version using ruby-build
#
# Usage: rbenv install [-f|-s] [-kpv] <version>
# Usage: rbenv install [-f|-s] [-kpv] <version> [-- <configure-args...>]
# rbenv install [-f|-s] [-kpv] <definition-file>
# rbenv install -l|--list
# rbenv install --list
# rbenv install --version
#
# -l/--list List latest stable versions for each Ruby
# -L/--list-all List all local versions
# -f/--force Install even if the version appears to be installed already
# -s/--skip-existing Skip if the version appears to be installed already
# -l, --list List latest stable versions for each Ruby
# -L, --list-all List all local versions, including outdated ones
# -f, --force Allow overwriting an existing installed version
# -s, --skip-existing Avoid overwriting an existing installed version
#
# ruby-build options:
#
# -k/--keep Keep source tree in $RBENV_BUILD_ROOT after installation
# (defaults to $RBENV_ROOT/sources)
# -p/--patch Apply a patch from stdin before building
# -v/--verbose Verbose mode: print compilation status to stdout
# --version Show version of ruby-build
# -v, --verbose Verbose mode: forward all build output to stdout/stderr
# -p, --patch Apply a patch from stdin before building
# -k, --keep Keep source tree in RBENV_BUILD_ROOT after installation
# (defaults to "RBENV_ROOT/sources")
# --version Show version of ruby-build
#
# For detailed information on installing Ruby versions with
# ruby-build, including a list of environment variables for adjusting
# compilation, see: https://github.com/rbenv/ruby-build#usage
# For detailed information on installing Ruby versions with ruby-build,
# including a list of environment variables for adjusting compilation,
# see: https://github.com/rbenv/ruby-build#usage
#
set -e
[ -n "$RBENV_DEBUG" ] && set -x
@ -100,7 +100,7 @@ for option in "${OPTIONS[@]}"; do
[ ! -t 1 ] || {
echo
echo "Only latest stable releases for each Ruby implementation are shown."
echo "Use 'rbenv install --list-all / -L' to show all local versions."
echo "Use \`rbenv install --list-all' to show all local versions."
} 1>&2
exit
;;
@ -239,7 +239,7 @@ if [ "$STATUS" == "2" ]; then
echo "$candidates" | indent
fi
echo
echo "See all available versions with \`rbenv install --list'."
echo "See all available versions with \`rbenv install --list-all'."
echo
echo -n "If the version you need is missing, try upgrading ruby-build"
if [ "$here" != "${here#"$(brew --prefix 2>/dev/null)"}" ]; then
@ -247,7 +247,7 @@ if [ "$STATUS" == "2" ]; then
echo " brew upgrade ruby-build"
elif [ -d "${here}/.git" ]; then
printf ":\n\n"
echo " git -C ${here} pull"
echo " git -C ${here/${HOME}\//~/} pull"
else
printf ".\n"
fi

View file

@ -1,17 +1,18 @@
#!/usr/bin/env bash
#
# Usage: ruby-build [-kpv] <definition> <prefix>
# ruby-build --definitions
# Usage: ruby-build [-kpv] <definition> <prefix> [-- <configure-args...>]
# ruby-build {--list|--definitions}
# ruby-build --version
#
# -k/--keep Do not remove source tree after installation
# -p/--patch Apply a patch from stdin before building
# -v/--verbose Verbose mode: print compilation status to stdout
# -4/--ipv4 Resolve names to IPv4 addresses only
# -6/--ipv6 Resolve names to IPv6 addresses only
# --definitions List all local definitions
# -l/--list List latest stable releases for each Ruby
# --version Show version of ruby-build
# -l, --list List latest stable releases for each Ruby
# --definitions List all local definitions, including outdated ones
# --version Show version of ruby-build
#
# -v, --verbose Verbose mode: forward all build output to stdout/stderr
# -p, --patch Apply a patch from stdin before building
# -k, --keep Do not remove source tree after installation
# -4, --ipv4 Resolve names to IPv4 addresses only
# -6, --ipv6 Resolve names to IPv6 addresses only
#
RUBY_BUILD_VERSION="20231025"

View file

@ -101,11 +101,11 @@ The following versions contain \`1.9.3' in the name:
1.9.3-p0
1.9.3-p194
See all available versions with \`rbenv install --list'.
See all available versions with \`rbenv install --list-all'.
If the version you need is missing, try upgrading ruby-build:
git -C ${BATS_TEST_DIRNAME}/.. pull
git -C ${BATS_TEST_DIRNAME/$HOME\//~/}/.. pull
OUT
unstub brew
@ -122,7 +122,7 @@ OUT
assert_output <<OUT
ERROR
See all available versions with \`rbenv install --list'.
See all available versions with \`rbenv install --list-all'.
If the version you need is missing, try upgrading ruby-build: