Skip to content

Commit 2c42a53

Browse files
committed
Refactor string.Format calls in CLI.
1 parent d46bcd3 commit 2c42a53

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/CLI/CLI.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ static void AddIncludeDirs(string dir, List<string> errorMessages)
101101
if (Directory.Exists(dir))
102102
options.IncludeDirs.Add(dir);
103103
else
104-
errorMessages.Add(string.Format("Directory '{0}' doesn't exist. Ignoring as include directory.", dir));
104+
errorMessages.Add($"Directory '{dir}' doesn't exist. Ignoring as include directory.");
105105
}
106106

107107
static void HandleOutputArg(string arg, List<string> errorMessages)
@@ -196,7 +196,7 @@ static void GetFilesFromPath(string path, List<string> errorMessages)
196196
}
197197
catch (Exception)
198198
{
199-
errorMessages.Add(string.Format("Error while looking for files inside path '{0}'. Ignoring.", path));
199+
errorMessages.Add($"Error while looking for files inside path '{path}'. Ignoring.");
200200
}
201201
}
202202

@@ -212,7 +212,7 @@ static void GetGeneratorKind(string generator, List<string> errorMessages)
212212
return;
213213
}
214214

215-
errorMessages.Add(string.Format("Unknown generator kind: {0}. Defaulting to {1}", generator, options.Kind.ToString()));
215+
errorMessages.Add($"Unknown generator kind: {generator}. Defaulting to {options.Kind}");
216216
}
217217

218218
static void GetDestinationPlatform(string platform, List<string> errorMessages)
@@ -230,7 +230,7 @@ static void GetDestinationPlatform(string platform, List<string> errorMessages)
230230
return;
231231
}
232232

233-
errorMessages.Add(string.Format("Unknown target platform: {0}. Defaulting to {1}", platform, options.Platform.ToString()));
233+
errorMessages.Add($"Unknown target platform: {platform}. Defaulting to {options.Platform}");
234234
}
235235

236236
static void GetDestinationArchitecture(string architecture, List<string> errorMessages)
@@ -245,7 +245,7 @@ static void GetDestinationArchitecture(string architecture, List<string> errorMe
245245
return;
246246
}
247247

248-
errorMessages.Add(string.Format("Unknown target architecture: {0}. Defaulting to {1}", architecture, options.Architecture.ToString()));
248+
errorMessages.Add($"Unknown target architecture: {architecture}. Defaulting to {options.Architecture}");
249249
}
250250

251251
static void PrintErrorMessages(List<string> errorMessages)

0 commit comments

Comments
 (0)