Sha256: 212201d6f9498df1d711cf6b6e0f319c0d151fecb6f61007b16d22acd9ccffeb

Contents?: true

Size: 754 Bytes

Versions: 4

Compression:

Stored size: 754 Bytes

Contents

#!/usr/bin/env ruby
#
# moflint
#
# MOF syntax checker
#  and Mofparser tester
#
# Usage: moflint [-I <incdir>] <moffile> [ <moffile> ... ]
#

require 'rubygems'
require 'pathname'

$:.push(File.join(File.dirname(__FILE__), '..', 'lib'))

require 'mof'

moffiles, options = MOF::Parser.argv_handler "moflint", ARGV
options[:style] ||= :cim;
options[:includes] ||= []
options[:includes].unshift(Pathname.new ".")

parser = MOF::Parser.new options

if moffiles.empty?
  $stderr.puts "Usage: moflint [-I <incdir>] <moffile> [ <moffile> ... ]"
  exit 1
end

begin
  result = parser.parse moffiles
rescue Exception => e
  parser.error_handler e
  exit 1
end

result.each do |name,res|
  puts "/*=============== #{name} ===================*/\n"
  puts res
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
mof-1.2.5 bin/moflint
mof-1.2.4 bin/moflint
mof-1.2.2 bin/moflint
mof-1.2.0 bin/moflint