add crash report cmdline options
MODIFY
WalletWasabi.Gui/CommandLine/CommandInterpreter.cs
WalletWasabi.Gui/CommandLine/CommandInterpreter.cs
@@ -35,7 +35,8 @@ namespace WalletWasabi.Gui.CommandLine
"Available commands are:",
"",
new MixerCommand(daemon),
- new PasswordFinderCommand(global.WalletManager)
+ new PasswordFinderCommand(global.WalletManager),
+ new CrashReportCommand(global)
};
EnsureBackwardCompatibilityWithOldParameters(ref args);

ADD
WalletWasabi.Gui/CommandLine/CrashReportCommand.cs
+using Mono.Options;
+using System;
+using System.Collections.Generic;
+using System.Threading.Tasks;
+using WalletWasabi.Helpers;
+using Newtonsoft.Json;
+using WalletWasabi.Logging;
+
+namespace WalletWasabi.Gui.CommandLine
+{
+ internal class CrashReportCommand : Command
+ {
+ public CrashReportCommand(Global global) : base("crashreport", "Activates the internal crash reporting mechanism.")
+ {
+ Global = Guard.NotNull(nameof(Global), global);
+
+ Options = new OptionSet()
+ {
+ { "e|exception=", "The serialized exception from the previous crash.", ExceptionDecode }
+ };
+ }
+
+ private void ExceptionDecode(string exceptionString)
+ {
+ try
+ {
+ var e = Guard.NotNullOrEmptyOrWhitespace(nameof(exceptionString), exceptionString);
+ ReportedException = JsonConvert.DeserializeObject<Exception>(e);
+
+ Global.ShowCrashReporter = true;
+ Global.CrashReportException = e;
+ }
+ catch (Exception ex)
+ {
+ Logger.LogCritical(ex.Message);
+ Environment.Exit(1);
+ }
+ }
+
+ public Global Global { get; }
+ public object ReportedException { get; private set; }
+
+ public override Task<int> InvokeAsync(IEnumerable<string> arguments)
+ {
+ return base.InvokeAsync(arguments);
+ }
+ }
+}

MODIFY
WalletWasabi.Gui/Global.cs
WalletWasabi.Gui/Global.cs
@@ -109,6 +109,8 @@ namespace WalletWasabi.Gui
private bool InitializationStarted { get; set; } = false;
private CancellationTokenSource StoppingCts { get; }
+ public bool ShowCrashReporter { get; set; }
+ public string CrashReportException { get; set; }
public async Task InitializeNoWalletAsync()
{

add crash report cmdline options