Sha256: 26c3657ed50b0d6d7c8504a965db65403a97dc4013907f25a747aef163be82a2

Contents?: true

Size: 1.14 KB

Versions: 1

Compression:

Stored size: 1.14 KB

Contents

#!/usr/bin/env ruby
# frozen_string_literal: true

# Copyright (C) 2017 Szymon Kopciewski
#
# This file is part of Mayaml.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
#
require "mayaml"

def puts_ussage_message
  puts <<-END_HELP
    Ussage: mayaml-check <path_to_yaml_file>
  END_HELP
end

def main(args)
  yaml_path = args.shift
  if yaml_path.nil?
    puts_ussage_message
    exit 1
  elsif File.exist? yaml_path
    Mayaml.accounts_from_file(yaml_path).each { |acc| puts acc.to_str }
  else
    puts "Could not find file: #{yaml_path}"
    exit 1
  end
end

main ARGV

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
mayaml-4.0.0 bin/mayaml-check