diff --git a/utilities/languageSupport/translateLabelsInOntology/label_inserter.rb b/utilities/languageSupport/translateLabelsInOntology/label_inserter.rb index c210f610..f3121c19 100755 --- a/utilities/languageSupport/translateLabelsInOntology/label_inserter.rb +++ b/utilities/languageSupport/translateLabelsInOntology/label_inserter.rb @@ -33,6 +33,8 @@ class LabelInserter # Parse the arguments and complain if they don't make sense. # def sanity_check_arguments(args) + raise UsageError, "usage is: label_inserter.rb [filter_file] [ok]" unless (3..5).include?(args.length) + if args[-1].downcase == 'ok' ok = true args.pop @@ -40,8 +42,6 @@ class LabelInserter ok = false end - raise UsageError, "usage is: label_inserter.rb [filter_file] [ok]" unless (4..5).include?(args.length) - n3_output_file = args.pop raise UsageError, "File '#{n3_output_file}' already exists. specify 'ok' to overwrite it." if File.exist?(n3_output_file) && !ok diff --git a/utilities/languageSupport/translateLabelsInOntology/label_stripper.rb b/utilities/languageSupport/translateLabelsInOntology/label_stripper.rb index efb67aa7..81c42501 100755 --- a/utilities/languageSupport/translateLabelsInOntology/label_stripper.rb +++ b/utilities/languageSupport/translateLabelsInOntology/label_stripper.rb @@ -32,6 +32,8 @@ class LabelStripper # Parse the arguments and complain if they don't make sense. # def sanity_check_arguments(args) + raise UsageError, "usage is: label_stripper.rb [filter_file] [ok]" unless (2..3).include?(args.length) + if args[-1].downcase == 'ok' ok = true args.pop @@ -39,8 +41,6 @@ class LabelStripper ok = false end - raise UsageError, "usage is: label_stripper.rb [filter_file] [ok]" unless (2..3).include?(args.length) - output_file = args.pop raise UsageError, "File '#{output_file}' already exists. specify 'ok' to overwrite it." if File.exist?(output_file) && !ok