Commit graph

33 commits

Author SHA1 Message Date
Mislav Marohnić
af454a32dc Silence errors when piping type | head -1 2019-10-23 12:12:38 +02:00
Hongli Lai
d38d18ec25
rbenv help: fix 'type: write error: Broken pipe'
Sometimes the command fails with a 'type: write error: Broken pipe'.
This is because 'head -1' only reads the first line, then exits.
If 'type' writes the second line after 'head -1' has already exited,
then the aforementioned error is triggered.

We fix this by buffering the entire output of 'type' before
invoking 'head -1'.
2019-10-23 08:29:03 +02:00
Daniel Hahler
5f8a4c4d62 Fix some issues reported by shellcheck 2017-11-29 16:20:51 +01:00
Chulki Lee
df4c16ecb4 update urls to rbenv 2015-12-07 11:03:07 -08:00
Jason Karns
a6cb4b6317 consistent completions for rbenv-help 2015-11-20 09:15:06 -05:00
Jason Karns
8c3cab61c7 add completion block for rbenv-help 2015-11-13 15:06:29 -05:00
Adam Harvey
808527b5d0 Prefer gawk over awk if both are available. 2014-04-18 10:40:56 +10:00
Leo Cassarani
1d687ac734 Fix incorrect formatting of rbenv-help output under MAWK
In systems that use the MAWK interpreter (the default AWK installed with
Ubuntu), the output of `rbenv help <command>` would have no line breaks.
The issue is fixed by changing `gsub` to `sub` in the snippet of awk
commands that are used to extract documentation comments.

I suspect the bug is something to do with the way the '^' and '$'
characters are interpreted by different AWK interpreters (per-line vs
per-string anchors).

If I understand correctly, the purpose of trim() is to remove all line
breaks from the start and end of each sections of a command's
documentation, in which case `sub` should serve the same purpose.
2013-01-05 16:55:19 +00:00
Sam Stephenson
266d896871 Prioritize rbenv local over rbenv global and rbenv shell 2013-01-03 10:40:28 -06:00
Sam Stephenson
51467dc4a3 Include install and uninstall in help if ruby-build is installed 2012-12-30 15:30:37 -06:00
Sam Stephenson
37eca782cc Documentation tweaks 2012-12-29 22:05:04 -06:00
Sam Stephenson
19666f2598 Wrap documentation comments at 70 columns 2012-12-29 21:50:38 -06:00
Mislav Marohnić
3436bddaea new-style documentation for most commands 2012-12-29 23:34:53 +01:00
Mislav Marohnić
5cc6b0e3d3 allow indented lines in help text
Before, lines of help that were indented were stripped away.
2012-12-29 22:48:28 +01:00
Mislav Marohnić
2b21e22e97 display help for commands that have Summary but not Usage
A command doesn't have to specify Usage docs if it doesn't accept any
arguments. The default usage for a command will be printed as:

    Usage: rbenv ${command}
2012-12-29 22:14:54 +01:00
Sam Stephenson
57df945738 Don't print version before help summary (bare rbenv already does this) 2012-12-29 12:19:06 -06:00
Sam Stephenson
e2e474c59d Add rbenv help --usage 2012-12-29 12:12:47 -06: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
Gabriel Horner
d3700dfd70 help for versions and commands, including their options 2012-03-23 16:21:53 -04:00
Sam Stephenson
72b62e13aa Make rbenv help a little nicer 2011-09-28 10:59:02 -05:00
Sam Stephenson
ada26ab92e Document rbenv which and rbenv whence 2011-09-28 10:48:04 -05:00
Sam Stephenson
058e2cb7a6 Add rbenv shell to help 2011-09-28 10:21:57 -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
Sam Stephenson
5be66da9f4 Rename rbenv-default to rbenv-global 2011-08-18 14:35:00 -05:00
Graham Ashton
1ed231cb21 Report default or local version.
If no argument is passed to the default or local sub commands, report
the currently configured version.
2011-08-13 08:26:54 +01:00
Graham Ashton
7a0cde9a4e Remove set- prefix from local and default commands. 2011-08-13 08:26:54 +01: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
Chris Moore
aae721c5f1 fix typo in rbenv help 2011-08-11 17:43:57 -04:00
Sam Stephenson
5c11f14c9b rbenv 0.1.0 2011-08-11 14:48:40 -05:00
Sam Stephenson
71493e8065 Typo 2011-08-10 09:31:53 -05:00
Sam Stephenson
5394347500 A few tweaks to the help text 2011-08-10 09:23:43 -05:00
Ryan Baumann
f2f8ef88a5 Implement some basic command line help 2011-08-10 09:53:34 -04:00