|
1 | | -using System.Net.Http; |
2 | 1 | using System.Text; |
3 | 2 | using ConsoleAppFramework; |
4 | 3 | using Devlooped; |
|
14 | 13 | /// Runs a file-based .NET app from a .cs entrypoint. |
15 | 14 | /// </summary> |
16 | 15 | /// <param name="input">Path to an existing .cs file or remote ref (owner/repo[@ref][:path]).</param> |
17 | | -/// <param name="r2r">Publish with ReadyToRun instead of native AOT; supports more dynamic .NET features while keeping most publish optimizations. Alias: --go-r2r.</param> |
18 | | -/// <param name="debug">Launch debugger before executing. Alias: --go-debug.</param> |
| 16 | +/// <param name="r2r">Publish with ReadyToRun instead of native AOT; supports more dynamic .NET features while keeping most publish optimizations. </param> |
| 17 | +/// <param name="goDebug">Launch debugger before executing.</param> |
19 | 18 | /// <param name="extraArgs">Arguments before '--' are passed to 'dotnet publish'; arguments after '--' are forwarded to the published app. Without '--', all extra arguments are forwarded to the published app. |
20 | 19 | /// </param> |
21 | | -static async Task<int> RunAsync([Argument] string input, bool r2r = false, bool debug = false, [Argument] params string[] extraArgs) |
| 20 | +static async Task<int> RunAsync([Argument] string input, bool r2r = false, [Hidden] bool goDebug = false, [Argument] params string[] extraArgs) |
22 | 21 | { |
23 | | - if (debug) |
| 22 | + if (goDebug) |
24 | 23 | System.Diagnostics.Debugger.Launch(); |
25 | 24 |
|
26 | 25 | var source = await GetEffectiveSourceAsync(input); |
@@ -58,8 +57,12 @@ state.App is not null && |
58 | 57 | /// </summary> |
59 | 58 | /// <param name="input">Path to an existing .cs file or remote ref (owner/repo[@ref][:path]).</param> |
60 | 59 | /// <param name="all">Delete cached artifacts for all apps instead.</param> |
61 | | -static int CleanAsync([Argument] string? input = null, bool all = false) |
| 60 | +/// <param name="goDebug">Launch debugger before executing.</param> |
| 61 | +static int CleanAsync([Argument] string? input = null, [Hidden] bool all = false, [Hidden] bool goDebug = false) |
62 | 62 | { |
| 63 | + if (goDebug) |
| 64 | + System.Diagnostics.Debugger.Launch(); |
| 65 | + |
63 | 66 | if (all) |
64 | 67 | { |
65 | 68 | if (input is not null) |
@@ -145,13 +148,13 @@ static int CleanAsync([Argument] string? input = null, bool all = false) |
145 | 148 | /// Runs a file-based .NET app from a .cs entrypoint using dotnet run for fast iteration. |
146 | 149 | /// </summary> |
147 | 150 | /// <param name="input">Path to an existing .cs file or remote ref (owner/repo[@ref][:path]).</param> |
148 | | -/// <param name="r2r">Accepted for consistency (ignored for dev which uses dotnet run). Alias: --go-r2r.</param> |
149 | | -/// <param name="debug">Launch debugger before executing. Alias: --go-debug.</param> |
| 151 | +/// <param name="r2r">Accepted for consistency (ignored for dev which uses dotnet run).</param> |
| 152 | +/// <param name="goDebug">Launch debugger before executing.</param> |
150 | 153 | /// <param name="extraArgs">Arguments before '--' are passed to 'dotnet run'; arguments after '--' are forwarded to the app. Without '--', all extra arguments are forwarded to the app. |
151 | 154 | /// </param> |
152 | | -static async Task<int> DevAsync([Argument] string input, bool r2r = false, bool debug = false, [Argument] params string[] extraArgs) |
| 155 | +static async Task<int> DevAsync([Argument] string input, [Hidden] bool r2r = false, [Hidden] bool goDebug = false, [Argument] params string[] extraArgs) |
153 | 156 | { |
154 | | - if (debug) |
| 157 | + if (goDebug) |
155 | 158 | System.Diagnostics.Debugger.Launch(); |
156 | 159 |
|
157 | 160 | var source = await GetEffectiveSourceAsync(input); |
|
0 commit comments