aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/cmd/commands.rb
diff options
context:
space:
mode:
authorXu Cheng2015-09-12 19:24:41 +0800
committerXu Cheng2015-09-12 19:24:41 +0800
commitc5bb3886533bf62a272a30265bb1663a1fcb0ce0 (patch)
tree169049d38360122a438bee82af1b4c61b1c7e766 /Library/Homebrew/cmd/commands.rb
parent14bb9accdf0a90c3fee60e19f751015bf135966e (diff)
downloadbrew-c5bb3886533bf62a272a30265bb1663a1fcb0ce0.tar.bz2
commands: better output
Diffstat (limited to 'Library/Homebrew/cmd/commands.rb')
-rw-r--r--Library/Homebrew/cmd/commands.rb19
1 files changed, 14 insertions, 5 deletions
diff --git a/Library/Homebrew/cmd/commands.rb b/Library/Homebrew/cmd/commands.rb
index b94ecca7d..7983f2ee9 100644
--- a/Library/Homebrew/cmd/commands.rb
+++ b/Library/Homebrew/cmd/commands.rb
@@ -2,6 +2,7 @@ module Homebrew
def commands
if ARGV.include? "--quiet"
cmds = internal_commands + external_commands
+ cmds += internal_development_commands if ARGV.homebrew_developer?
cmds += HOMEBREW_INTERNAL_COMMAND_ALIASES.keys if ARGV.include? "--include-aliases"
puts_columns cmds.sort
else
@@ -9,6 +10,13 @@ module Homebrew
puts "Built-in commands"
puts_columns internal_commands
+ # Find commands in Homebrew/dev-cmd
+ if ARGV.homebrew_developer?
+ puts
+ puts "Built-in development commands"
+ puts_columns internal_development_commands
+ end
+
# Find commands in the path
unless (exts = external_commands).empty?
puts
@@ -20,11 +28,12 @@ module Homebrew
def internal_commands
with_directory = false
- cmds = (HOMEBREW_LIBRARY_PATH/"cmd").children(with_directory).map { |f| File.basename(f, ".rb") }
- if ARGV.homebrew_developer?
- cmds += (HOMEBREW_LIBRARY_PATH/"dev-cmd").children(with_directory).map { |f| File.basename(f, ".rb") }
- end
- cmds
+ (HOMEBREW_LIBRARY_PATH/"cmd").children(with_directory).map { |f| File.basename(f, ".rb") }
+ end
+
+ def internal_development_commands
+ with_directory = false
+ (HOMEBREW_LIBRARY_PATH/"dev-cmd").children(with_directory).map { |f| File.basename(f, ".rb") }
end
def external_commands