Fix: defaults should be defaults and not override parsed settings.

This commit is contained in:
Jens Maier 2014-07-29 22:53:41 +02:00
parent 958e3faf94
commit b17611f2db
1 changed files with 4 additions and 6 deletions

View File

@ -405,12 +405,6 @@ class ImportScripts::Smf2 < ImportScripts::Base
class Error < StandardError ; end
class SettingsError < Error ; end
def initialize
self.host = 'localhost'
self.username = Etc.getlogin
self.prefix = 'smf_'
end
def parse!(args = ARGV)
raise Error, 'not enough arguments' if ARGV.empty?
begin
@ -421,6 +415,10 @@ class ImportScripts::Smf2 < ImportScripts::Base
raise Error, 'too many arguments' if args.length > 1
self.smfroot = args.first
read_smf_settings if self.smfroot
self.host ||= 'localhost'
self.username ||= Etc.getlogin
self.prefix ||= 'smf_'
end
def usage