Skip to content

Commit c21a354

Browse files
committed
more logging
1 parent 1dd8c20 commit c21a354

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

generator/CSharpReference.cs

+17-1
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,7 @@ static async Task<VpkCommand> GetVpkHelpForDirective(string directive, string vp
274274
{
275275
var help = await RunCaptureStdOut("dotnet", [vpkDll, directive, "-h"]);
276276
var root = new VpkCommand("", help);
277+
277278
await RecursivelyPopulateSubCommands(root, [vpkDll, directive]);
278279
return root;
279280
}
@@ -308,17 +309,32 @@ public VpkCommand(string name, string helpText)
308309

309310
static string[] GetCommandsFromHelp(string stdout)
310311
{
312+
Console.WriteLine("Trying to determine sub commands from output:");
313+
Console.WriteLine(stdout);
314+
311315
var commandsIdx = stdout.IndexOf("Commands:");
312316
if (commandsIdx == -1) return [];
313317
var commandsText = stdout.Substring(commandsIdx);
314318

315319
var lines = commandsText.Split(new[] { '\n', '\r' }, StringSplitOptions.RemoveEmptyEntries);
316320

317-
return lines.Skip(1)
321+
Console.WriteLine("Lines: ");
322+
foreach (var line in lines) {
323+
Console.WriteLine(" - " + line);
324+
}
325+
326+
var commands = lines.Skip(1)
318327
.Where(l => !l.StartsWith(" "))
319328
.Select(l => l.Trim())
320329
.Select(l => l.Substring(0, l.IndexOf(" ")))
321330
.ToArray();
331+
332+
Console.WriteLine("Commands: ");
333+
foreach (var cmd in commands) {
334+
Console.WriteLine(" - " + cmd);
335+
}
336+
337+
return commands;
322338
}
323339

324340
static async Task<string> RunCaptureStdOut(string exePath, string[] args)

0 commit comments

Comments
 (0)