This is probably a simple question that I'm just not figuring out how to word correctly lol. Anyway, allow me to describe my problem.
So I have written a program that helps users manage their installation of their program. For obvious reasons, I offer a GUI and command-line access to this app (the GUI is in WPF).
Anyway, so my problem is with outputting a bunch of text to the command line. Here's my code:
void WriteHelp()
{
// Attach to console to write out to it
if (AttachConsole(-1))
{
Console.WriteLine("InstallAssist helps maintain your Shine Calendar installation.");
Console.WriteLine("Version " + VERSION_STRING + " (" + VERSION_ID + ")");
Console.WriteLine("Written by Jayke R. Huempfner. Copyright 2018.");
Console.WriteLine();
Console.WriteLine("Can be accessed through GUI or by using the arguments below:");
Console.WriteLine();
Console.WriteLine("Argument Action");
Console.WriteLine("-------- ------");
Console.WriteLine("-about (-a) Displays version/system info");
Console.WriteLine("-hardreset (-hr) Perform a hard reset");
Console.WriteLine("-help (-?) Displays this help page.");
Console.WriteLine("-info (-i) Displays version/system info");
Console.WriteLine("-quiet (-q) Quiet mode, don't display GUI");
Console.WriteLine("-reset (-e) Display reset options GUI");
Console.WriteLine("-skipconfirm (-sc) Skip confirmation GUI screen");
Console.WriteLine("-softreset (-s) Perform a soft reset");
Console.WriteLine("-uninstall (-u) Uninstall, keeping user data");
Console.WriteLine("-uninstallall (-ua) Uninstall, deleting user data");
Console.WriteLine();
Console.WriteLine("More information available online at:");
Console.WriteLine("https://shinecalendar.com/help/advanced");
}
}
It seems pretty straightforward, doesn't it? I'd think the result would be pretty obvious. However, when I go into PowerShell and access it, this is what I get:
PS C:\Users\jacob\Documents\Visual Studio 2017\Projects\ShineCalendar\ShineWin\bin\Release> .\InstallAssist.exe -help
PS C:\Users\jacob\Documents\Visual Studio 2017\Projects\ShineCalendar\ShineWin\bin\Release> InstallAssist helps maintain your Shine Calendar installation.
Version 0.8.0 (800)
Written by Jayke R. Huempfner. Copyright 2018.
Can be accessed through GUI or by using the arguments below:
Argument Action
-------- ------
-about (-a) Displays version/system info
-hardreset (-hr) Perform a hard reset
-help (-?) Displays this help page.
-info (-i) Displays version/system info
-quiet (-q) Quiet mode, don't display GUI
-reset (-e) Display reset options GUI
-skipconfirm (-sc) Skip confirmation GUI screen
-softreset (-s) Perform a soft reset
-uninstall (-u) Uninstall, keeping user data
-uninstallall (-ua) Uninstall, deleting user data
More information available online at:
https://shinecalendar.com/help/advanced
The formatting comes out all okay and whatever, but the problem is that the top line is being written into the next command input. As I start typing in more commands and whatnot, it ends up overwriting lines. (i.e.:
PS C:\Users\jacob\Documents\Visual Studio 2017\Projects\ShineCalendar\ShineWin\bin\Release> .\InstallAssist.exe -help
PS C:\Users\jacob\Documents\Visual Studio 2017\Projects\ShineCalendar\ShineWin\bin\Release> dir
lation.
Version 0.8.0 (800)
Directory: C:\Users\jacob\Documents\Visual Studio 2017\Projects\ShineCalendar\ShineWin\bin\Release
Can be accessed through GUI or by using the arguments below:
Mode LastWriteTime Length Name
---- ------------- ------ ----
-a---- 9/9/2016 2:59 PM 77312 CsvHelper.dll
... (rest omitted)
)
What do I do so that it writes the output and then displays the whole "PS C:\Users\...\bin\Release>" thing afterwards?