diff options
| author | Martin Afanasjew | 2016-04-17 09:36:48 +0200 |
|---|---|---|
| committer | Martin Afanasjew | 2016-04-20 13:45:26 +0200 |
| commit | d29d58b3fb1d34d990e2cba5e3f60ab0617b4582 (patch) | |
| tree | 2022d9c3a08629ac8ffe3ba63be657a8387c4283 /Library | |
| parent | d183ff8065aafd3def71f9c9c728a3a92c1c4742 (diff) | |
| download | brew-d29d58b3fb1d34d990e2cba5e3f60ab0617b4582.tar.bz2 | |
man: put option-style commands after regular ones
Diffstat (limited to 'Library')
| -rw-r--r-- | Library/Homebrew/cmd/man.rb | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/Library/Homebrew/cmd/man.rb b/Library/Homebrew/cmd/man.rb index eb6679743..bc382d29f 100644 --- a/Library/Homebrew/cmd/man.rb +++ b/Library/Homebrew/cmd/man.rb @@ -44,7 +44,7 @@ module Homebrew variables = OpenStruct.new variables[:commands] = Pathname.glob("#{HOMEBREW_LIBRARY_PATH}/cmd/*.{rb,sh}"). - sort_by { |source_file| source_file.basename.sub(/\.(rb|sh)$/, "") }. + sort_by { |source_file| sort_key_for_path(source_file) }. map { |source_file| source_file.read.lines. grep(/^#:/). @@ -56,6 +56,11 @@ module Homebrew ERB.new(template, nil, ">").result(variables.instance_eval{ binding }) end + def sort_key_for_path(path) + # Options after regular commands (`~` comes after `z` in ASCII table). + path.basename.to_s.sub(/\.(rb|sh)$/, "").sub(/^--/, "~~") + end + def convert_man_page(markup, target) shared_args = %W[ --pipe |
