@@ -16,10 +16,10 @@ public static string[] Map(string[] arg, Dictionary<string, string?> dicts, stri
1616 var args = new List < string > ( arg . Length ) ;
1717 foreach ( string item in arg )
1818 {
19- var a = Interpolation ( item , dicts ) ;
19+ var a = Interpolation ( item , dicts , false ) ;
2020 if ( checkPath )
2121 a = ToFullPath ( a , prepath ) ;
22- args . Add ( handleEArg ( a ) ) ;
22+ args . Add ( HandleEmptyArg ( a ) ) ;
2323 }
2424
2525 return args . ToArray ( ) ;
@@ -30,8 +30,8 @@ public static string[] MapInterpolation(string[] arg, Dictionary<string, string?
3030 var args = new List < string > ( arg . Length ) ;
3131 foreach ( string item in arg )
3232 {
33- var a = Interpolation ( item , dicts ) ;
34- args . Add ( handleEArg ( a ) ) ;
33+ var a = Interpolation ( item , dicts , true ) ;
34+ args . Add ( a ) ;
3535 }
3636
3737 return args . ToArray ( ) ;
@@ -43,15 +43,15 @@ public static string[] MapPathString(string[] arg, string prepath)
4343 foreach ( string item in arg )
4444 {
4545 var a = ToFullPath ( item , prepath ) ;
46- args . Add ( handleEArg ( a ) ) ;
46+ args . Add ( HandleEmptyArg ( a ) ) ;
4747 }
4848
4949 return args . ToArray ( ) ;
5050 }
5151
52- public static string Interpolation ( string str , Dictionary < string , string ? > dicts )
52+ public static string Interpolation ( string str , Dictionary < string , string ? > dicts , bool handleEmpty )
5353 {
54- str = argBracket . Replace ( str , new MatchEvaluator ( ( match =>
54+ str = argBracket . Replace ( str , ( match =>
5555 {
5656 if ( match . Groups . Count < 2 )
5757 return match . Value ;
@@ -66,9 +66,12 @@ public static string Interpolation(string str, Dictionary<string, string?> dicts
6666 }
6767
6868 return match . Value ;
69- } ) ) ) ;
69+ } ) ) ;
7070
71- return str ;
71+ if ( handleEmpty )
72+ return HandleEmptyArg ( str ) ;
73+ else
74+ return str ;
7275 }
7376
7477 public static string ToFullPath ( string str , string prepath )
@@ -114,7 +117,7 @@ static string replaceByPos(StringBuilder sb, string replace, int startIndex, int
114117 // key="va l" => key="va l"
115118 // va lue => "va lue"
116119 // "va lue" => "va lue"
117- static string handleEArg ( string input )
120+ public static string HandleEmptyArg ( string input )
118121 {
119122 if ( input . Contains ( "=" ) )
120123 {
0 commit comments