Commit graph

15 commits

Author SHA1 Message Date
Mislav Marohnić 228fbf4c4f
Fix traversing PATH for bash < 4.4
Bash versions before 4.4 did not support the `-d` nor `-t` flags for readarray:
https://lists.gnu.org/archive/html/info-gnu/2016-09/msg00012.html

This switches away from readarray/"read" completely in favor of traversing PATH
by using string substitution.
2025-01-08 14:29:19 +01:00
Mislav Marohnić 2e3ef01abb
Use readarray in bash v4+ to avoid rbenv init hanging
For just a handful of people, rbenv init would hang indefinitely. Turning on
debugging output suggested that the `read` expression to split PATH into a bash
array was hanging, but I could never reproduce this myself. Instead, this uses
bash v4+ `readarray` if it's available, or falls back to bash v3 `read` with the
default DELIM being a newline character. This will cause a regression if any PATH
entries contain a literal newline character, but hopefully people are not relying
on such paths.
2025-01-07 23:40:54 +01:00
Mislav Marohnić ac020225c2
Clarify help text of some commands (#1567) 2024-04-29 14:20:47 +02:00
Mislav Marohnić 8275e15cb0
Use read -a to split output into an array (#1450) 2022-10-09 14:48:13 +02:00
Daniel Hahler 5f8a4c4d62 Fix some issues reported by shellcheck 2017-11-29 16:20:51 +01:00
Mislav Marohnić baf7656d2f fix iterating through paths that have spaces in them
Fixes #344, #196
2013-04-01 01:04:19 +02:00
Sam Stephenson 4c19dc22d7 Improve syntax for inline documentation and allow for multi-line usage 2012-12-29 12:06:20 -06:00
Mislav Marohnić b8715bfee6 foundation for a help system where each command holds its own docs
Docs are comprised from "Usage", "Summary" and "Help" sections, where
"Help" can span multiple commented lines. If it is missing, "Summary" is
shown in its place.

References #204, references #206
2012-12-13 05:48:28 +01:00
Sam Stephenson b4f8906b24 Update zsh completion adapter 2011-09-13 13:12:04 -05:00
Sam Stephenson 69d596f56f Completion for commands 2011-09-13 12:48:49 -05:00
Sam Stephenson 0632325a43 Set RBENV_DEBUG=1 to see what's going on under the hood 2011-09-12 10:11:59 -05:00
Joshua Peek c928ba7a21 Include sh commands in default listing 2011-09-06 22:07:05 -05:00
Joshua Peek 5a4bee6eb5 List sh commands separately 2011-08-23 11:34:03 -05:00
Andreas Johansson 6938692ca2 Fix argument that cannot be sent to bash via env
/usr/bin/env seems to have problems with arguments to bash on some
platforms. To bypass this, use set -e instead.
2011-08-12 11:33:45 +02:00
Sam Stephenson 3b13dc9c14 Add rbenv-commands 2011-08-03 22:20:01 -05:00