@@ -274,6 +274,7 @@ static async Task<VpkCommand> GetVpkHelpForDirective(string directive, string vp
274
274
{
275
275
var help = await RunCaptureStdOut ( "dotnet" , [ vpkDll , directive , "-h" ] ) ;
276
276
var root = new VpkCommand ( "" , help ) ;
277
+
277
278
await RecursivelyPopulateSubCommands ( root , [ vpkDll , directive ] ) ;
278
279
return root ;
279
280
}
@@ -308,17 +309,32 @@ public VpkCommand(string name, string helpText)
308
309
309
310
static string [ ] GetCommandsFromHelp ( string stdout )
310
311
{
312
+ Console . WriteLine ( "Trying to determine sub commands from output:" ) ;
313
+ Console . WriteLine ( stdout ) ;
314
+
311
315
var commandsIdx = stdout . IndexOf ( "Commands:" ) ;
312
316
if ( commandsIdx == - 1 ) return [ ] ;
313
317
var commandsText = stdout . Substring ( commandsIdx ) ;
314
318
315
319
var lines = commandsText . Split ( new [ ] { '\n ' , '\r ' } , StringSplitOptions . RemoveEmptyEntries ) ;
316
320
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 )
318
327
. Where ( l => ! l . StartsWith ( " " ) )
319
328
. Select ( l => l . Trim ( ) )
320
329
. Select ( l => l . Substring ( 0 , l . IndexOf ( " " ) ) )
321
330
. ToArray ( ) ;
331
+
332
+ Console . WriteLine ( "Commands: " ) ;
333
+ foreach ( var cmd in commands ) {
334
+ Console . WriteLine ( " - " + cmd ) ;
335
+ }
336
+
337
+ return commands ;
322
338
}
323
339
324
340
static async Task < string > RunCaptureStdOut ( string exePath , string [ ] args )
0 commit comments