MCPcopy Create free account
hub / github.com/NatLabRockies/OpenStudio / execute

Method execute

ruby/engine/openstudio_cli.rb:1788–1812  ·  view source on GitHub ↗

Executes the OpenStudio commands to return the OpenStudio version @param [Array] sub_argv Options passed to the energyplus_version command from the user input @return [Fixnum] Return status

(sub_argv)

Source from the content-addressed store, hash-verified

1786 # @return [Fixnum] Return status
1787 #
1788 def execute(sub_argv)
1789
1790 $logger.info "OpenStudioVersion, sub_argv = #{sub_argv}"
1791
1792 options = {}
1793
1794 opts = OptionParser.new do |o|
1795 o.banner = 'Usage: openstudio openstudio_version'
1796 end
1797
1798 # Parse the options
1799 argv = parse_options(opts, sub_argv)
1800 return 0 if argv == nil
1801
1802 $logger.debug("OpenStudioVersion command: #{argv.inspect} #{options.inspect}")
1803
1804 unless argv == []
1805 $logger.error 'Extra arguments passed to the openstudio_version command.'
1806 return 1
1807 end
1808
1809 safe_puts OpenStudio.openStudioLongVersion
1810
1811 0
1812 end
1813end
1814
1815# Class to return the EnergyPlus version

Callers

nothing calls this directly

Calls 5

parse_optionsFunction · 0.85
safe_putsFunction · 0.85
infoMethod · 0.80
debugMethod · 0.80
errorMethod · 0.45

Tested by

no test coverage detected