X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=mcs%2Ftools%2Ftxt2sr%2Ftxt2sr.cs;h=7a103203f23c7d6c877e04d6ea779d397c83ab84;hb=dfac8517b91687f11479801fa0a2191585b1ad4c;hp=bf30b54e865782da427ced9d9f0753168f2c6a7f;hpb=196497780f01da0d275fafa1524bc2100459ee27;p=mono.git diff --git a/mcs/tools/txt2sr/txt2sr.cs b/mcs/tools/txt2sr/txt2sr.cs index bf30b54e865..7a103203f23 100644 --- a/mcs/tools/txt2sr/txt2sr.cs +++ b/mcs/tools/txt2sr/txt2sr.cs @@ -38,6 +38,7 @@ public class Program public bool ShowHelp { get; set; } public bool Verbose { get; set; } public List ResourcesStrings { get; } + public bool IgnoreSemicolon { get; set; } public CmdOptions () { @@ -55,7 +56,9 @@ public class Program { "h|help", "Display available options", v => options.ShowHelp = v != null }, { "v|verbose", "Use verbose output", - v => options.Verbose = v != null }, + v => options.Verbose = v != null }, + { "ignore-semicolon", "Reads lines starting with semicolon", + v => options.IgnoreSemicolon = v != null }, }; List extra; @@ -142,14 +145,22 @@ public class Program foreach (var l in File.ReadLines (fileName)) { var line = l.Trim (); - if (line.Length == 0 || line [0] == '#' || line [0] == ';') + if (line.Length == 0 || line [0] == '#') continue; + int start = 0; + if (line [0] == ';') { + if (!options.IgnoreSemicolon) + continue; + + start = 1; + } + var epos = line.IndexOf ('='); if (epos < 0) continue; - var key = line.Substring (0, epos).Trim (); + var key = line.Substring (start, epos - start).Trim (); if (key.Contains (" ")) continue;