Skip to content

Commit 94e5425

Browse files
committed
Add --text option to the exe for debugging
1 parent e06abd0 commit 94e5425

File tree

1 file changed

+9
-3
lines changed
  • src/fsharp/FSharp.Compiler.Service.ProjectCracker.Exe

1 file changed

+9
-3
lines changed

src/fsharp/FSharp.Compiler.Service.ProjectCracker.Exe/Program.fs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -408,6 +408,9 @@ module Program =
408408

409409
[<EntryPoint>]
410410
let main argv =
411+
let text = Array.exists (fun (s: string) -> s = "--text") argv
412+
let argv = Array.filter (fun (s: string) -> s <> "--text") argv
413+
411414
let ret, opts =
412415
try
413416
addMSBuildv14BackupResolution ()
@@ -424,7 +427,10 @@ module Program =
424427
with e ->
425428
2, { ProjectFile = ""; Options = [||]; ReferencedProjectOptions = [||]; LogOutput = e.ToString() }
426429

427-
let fmt = new BinaryFormatter()
428-
use out = new StreamWriter(System.Console.OpenStandardOutput())
429-
fmt.Serialize(out.BaseStream, opts)
430+
if text then
431+
printfn "%A" opts
432+
else
433+
let fmt = new BinaryFormatter()
434+
use out = new StreamWriter(System.Console.OpenStandardOutput())
435+
fmt.Serialize(out.BaseStream, opts)
430436
ret

0 commit comments

Comments
 (0)