Skip to content

Commit

Permalink
Use warn not puts for error messages in mod-2-raw.
Browse files Browse the repository at this point in the history
  • Loading branch information
hainesr committed Apr 12, 2019
1 parent 52cbf92 commit d370c93
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions examples/mod-2-raw
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
#!/usr/bin/env ruby
# frozen_string_literal: true

# Copyright (c) 2018 Robert Haines.
# Copyright (c) 2018, 2019 Robert Haines.
#
# Licensed under the BSD License. See LICENCE for details.

require 'ffi/openmpt'

def get_filename(var)
if var.nil?
puts 'Please supply a filename to interrogate.'
warn 'Please supply a filename to interrogate.'
exit(1)
end

Expand All @@ -28,13 +28,13 @@ end

# Does this file exist? Is it readable?
unless ::File.readable?(mod_path)
puts "'#{mod_path}' does not exist, or is not readable."
warn "'#{mod_path}' does not exist, or is not readable."
exit(1)
end

# Can libopenmpt open this file?
unless ::FFI::OpenMPT.probe_file(mod_path)
puts 'libopenmpt can not open this file. Are you sure it is a mod?'
warn 'libopenmpt can not open this file. Are you sure it is a mod?'
exit(1)
end

Expand Down

0 comments on commit d370c93

Please sign in to comment.