Clarify help text of some commands (#1567)

This commit is contained in:
Mislav Marohnić 2024-04-29 14:20:47 +02:00 committed by GitHub
parent f2ac882579
commit ac020225c2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 25 additions and 5 deletions

View File

@ -1,6 +1,12 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# Summary: List all available rbenv commands # Summary: List all available rbenv commands
# Usage: rbenv commands [--sh|--no-sh] # Usage: rbenv commands [--sh|--no-sh]
#
# List names of all rbenv commands, including 3rd-party ones found in the
# PATH or in rbenv plugins. With `--sh`, list only shell commands.
#
# This functionality is mainly meant for scripting. To see usage help for
# rbenv, run `rbenv help`.
set -e set -e
[ -n "$RBENV_DEBUG" ] && set -x [ -n "$RBENV_DEBUG" ] && set -x

View File

@ -2,7 +2,7 @@
# #
# Summary: Run an executable with the selected Ruby version # Summary: Run an executable with the selected Ruby version
# #
# Usage: rbenv exec <command> [arg1 arg2...] # Usage: rbenv exec <command> [<args>...]
# #
# Runs an executable by first preparing PATH so that the selected Ruby # Runs an executable by first preparing PATH so that the selected Ruby
# version's `bin' directory is at the front. # version's `bin' directory is at the front.

View File

@ -164,8 +164,11 @@ if [ -z "$1" ] || [ "$1" == "rbenv" ]; then
echo "Usage: rbenv <command> [<args>...]" echo "Usage: rbenv <command> [<args>...]"
[ -n "$usage" ] && exit [ -n "$usage" ] && exit
echo echo
echo "Some useful rbenv commands are:" echo "Commands to manage available Ruby versions:"
print_summaries commands local global shell install uninstall rehash version versions which whence print_summaries versions install uninstall rehash
echo
echo "Commands to view or change the current Ruby version:"
print_summaries version local global shell
echo echo
echo "See \`rbenv help <command>' for information on a specific command." echo "See \`rbenv help <command>' for information on a specific command."
echo "For full documentation, see: https://github.com/rbenv/rbenv#readme" echo "For full documentation, see: https://github.com/rbenv/rbenv#readme"

View File

@ -1,5 +1,16 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# Summary: Rehash rbenv shims (run this after installing executables) # Summary: Regenerate rbenv shims
#
# Regenerate shims for every Ruby executable in `$RBENV_ROOT/versions/*/bin'
# and write them to the `$RBENV_ROOT/shims' directory. A shell environment
# properly set up for rbenv will have this shims directory in PATH, which is
# the core mechanism for Ruby version switching.
#
# Running rbenv rehash should only be necessary after installing new Ruby
# versions or gems. Note that this is sometimes done automatically: the
# `rbenv install' command from the ruby-build plugin runs rehash after
# every successful installation, and a RubyGems plugin that ships with
# rbenv runs rehash after every `gem install' command.
set -e set -e
[ -n "$RBENV_DEBUG" ] && set -x [ -n "$RBENV_DEBUG" ] && set -x

View File

@ -6,7 +6,7 @@ load test_helper
run rbenv-help run rbenv-help
assert_success assert_success
assert_line "Usage: rbenv <command> [<args>...]" assert_line "Usage: rbenv <command> [<args>...]"
assert_line "Some useful rbenv commands are:" assert_line "Commands to manage available Ruby versions:"
} }
@test "usage flag" { @test "usage flag" {