move alias registration into a separate register() method

This commit is contained in:
Zachary Flower 2018-02-10 18:03:18 -07:00
parent bbb3cdaa9a
commit 17f13785ce
1 changed files with 16 additions and 10 deletions

View File

@ -15,6 +15,18 @@ module Vagrant
# separate keyword-command pairs
keyword, command = line.split("=").collect(&:strip)
register(keyword, command)
end
end
end
# This returns all the registered alias commands.
def commands
@aliases
end
# This registers an alias.
def register(keyword, command)
@aliases.register(keyword.to_sym) do
lambda do |args|
# directly execute shell commands
@ -28,9 +40,3 @@ module Vagrant
end
end
end
def commands
@aliases
end
end
end