diff --git a/lib/katip/change_logger.rb b/lib/katip/change_logger.rb index 6b2f401..e83fba5 100644 --- a/lib/katip/change_logger.rb +++ b/lib/katip/change_logger.rb @@ -56,10 +56,8 @@ def parse_change_log tags = tags.split prev_begin = nil - if !tags.include?(@tag_from) or !tags.include?(@tag_to) - puts 'Could not find the given tags. Make sure that both of tags exist.' - puts 'Listing found tags:' - puts tags + if (!@tag_from.nil? && !tags.include?(@tag_from)) || (!@tag_to.nil? && !tags.include?(@tag_to)) + show_not_found_message(tags) return output end @@ -115,5 +113,11 @@ def parse_change_log output end + + def show_not_found_message(tags) + puts 'Could not find the given tags. Make sure that given tags exist.' + puts 'Listing found tags:' + puts tags + end end end