# File lib/facter/util/resolution.rb, line 92
 92:   def self.expand_command(command)
 93:     if match = /^"(.+?)"(?:\s+(.*))?/.match(command)
 94:       exe, arguments = match.captures
 95:       exe = which(exe) and [ "\"#{exe}\"", arguments ].compact.join(" ")
 96:     elsif match = /^'(.+?)'(?:\s+(.*))?/.match(command) and not Facter::Util::Config.is_windows?
 97:       exe, arguments = match.captures
 98:       exe = which(exe) and [ "'#{exe}'", arguments ].compact.join(" ")
 99:     else
100:       exe, arguments = command.split(/ /,2)
101:       if exe = which(exe)
102:         # the binary was not quoted which means it contains no spaces. But the
103:         # full path to the binary may do so.
104:         exe = "\"#{exe}\"" if exe =~ /\s/ and Facter::Util::Config.is_windows?
105:         exe = "'#{exe}'" if exe =~ /\s/ and not Facter::Util::Config.is_windows?
106:         [ exe, arguments ].compact.join(" ")
107:       end
108:     end
109:   end