Skip to content

Commit

Permalink
Added the ability to set Mumble Reader listen name from the command line
Browse files Browse the repository at this point in the history
Reworked command line arguments handling
Properly reupload failed logs after command line method resolves
  • Loading branch information
Plenyx committed May 21, 2024
1 parent df39feb commit 52c71fd
Showing 1 changed file with 23 additions and 11 deletions.
34 changes: 23 additions & 11 deletions Forms/FormMain.cs
Original file line number Diff line number Diff line change
Expand Up @@ -609,23 +609,35 @@ protected async Task StartUpAndCommandArgs()
var args = Environment.GetCommandLineArgs();
if (args.Length <= 1)
{
LogReuploader.ProcessLogs(HttpUploadLogAsync);
return;
}
if (((args.Length == 2) || (args.Length == 3)) && args[1].Equals("-m"))
var argCount = 0;
var skipOne = false;
foreach (var arg in args)
{
StartedMinimised = true;
WindowState = FormWindowState.Minimized;
if (checkBoxTrayMinimiseToIcon.Checked)
argCount++;
if (skipOne || arg.Equals(Application.ExecutablePath))
{
ShowInTaskbar = false;
Hide();
continue;
}
return;
}
foreach (var arg in args)
{
if (arg.Equals(Application.ExecutablePath))
if (arg.Equals("-m"))
{
StartedMinimised = true;
WindowState = FormWindowState.Minimized;
if (checkBoxTrayMinimiseToIcon.Checked)
{
ShowInTaskbar = false;
Hide();
}
}
if (arg.Equals("-ml"))
{
if (args.Length > argCount)
{
MumbleReader = new MumbleReader(false, args[argCount + 1]);
skipOne = true;
}
continue;
}
if (File.Exists(arg) && (arg.EndsWith(".evtc") || arg.EndsWith(".zevtc")))
Expand Down

0 comments on commit 52c71fd

Please sign in to comment.