From b13665b2751ee1c741ddef5e0cbc8a15c81d246f Mon Sep 17 00:00:00 2001 From: Sercan Turkmen Date: Mon, 3 Apr 2017 11:51:55 +0300 Subject: [PATCH] Fix error messages --- InlineYAML.hx | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/InlineYAML.hx b/InlineYAML.hx index c3614d1..3e6bd51 100644 --- a/InlineYAML.hx +++ b/InlineYAML.hx @@ -6,7 +6,7 @@ class InlineYAML { static function main() : Int { var args = Sys.args(); if (args == null || args.length < 2) { - Sys.stderr().writeString("expected 2 args but got less. inline-ymal in out"); + Sys.println("Error: expected 2 args but got less. example: inline-ymal in out"); return 1; } @@ -60,7 +60,13 @@ class InlineYAML { var result : String = value; var newVal = reg.map(value, function(r) : String { var match = r.matched(1); - return usingMap.get(match); + var resultVal = usingMap.get(match); + if (resultVal == null) { + resultVal = r.matched(0); + Sys.println('Warning: can\'t find value for key: \'$match\' used in $value'); + } + + return resultVal; }); return result != newVal ? newVal : null;