mirror of
https://github.com/pyenv/pyenv.git
synced 2024-11-21 20:47:00 -05:00
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.
This commit is contained in:
parent
bef7a12964
commit
1d687ac734
1 changed files with 2 additions and 2 deletions
|
@ -64,8 +64,8 @@ collect_documentation() {
|
|||
}
|
||||
|
||||
function trim(str) {
|
||||
gsub(/^\n*/, "", str)
|
||||
gsub(/\n*$/, "", str)
|
||||
sub(/^\n*/, "", str)
|
||||
sub(/\n*$/, "", str)
|
||||
return str
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue