From 9f568b155850e02d29a1c8475d1502620227abe4 Mon Sep 17 00:00:00 2001 From: Erik Darling <2136037+erikdarlingdata@users.noreply.github.com> Date: Sun, 22 Feb 2026 17:03:34 -0500 Subject: [PATCH] Add CLI --help flag and fix Lite status bar text color (#111) - Add --help/-h flag to CLI installer showing usage, options, env vars, and exit codes - Fix Lite status bar text from gray (ForegroundMutedBrush) to white (ForegroundBrush) for readability Co-Authored-By: Claude Opus 4.6 --- Installer/Program.cs | 30 ++++++++++++++++++++++++++++++ Lite/MainWindow.xaml | 10 +++++----- 2 files changed, 35 insertions(+), 5 deletions(-) diff --git a/Installer/Program.cs b/Installer/Program.cs index 6689f45b..952fe273 100644 --- a/Installer/Program.cs +++ b/Installer/Program.cs @@ -82,6 +82,36 @@ static async Task Main(string[] args) --encrypt=X Connection encryption: mandatory (default), optional, strict --trust-cert Trust server certificate without validation (default: require valid cert) */ + if (args.Any(a => a.Equals("--help", StringComparison.OrdinalIgnoreCase) + || a.Equals("-h", StringComparison.OrdinalIgnoreCase))) + { + Console.WriteLine("Usage:"); + Console.WriteLine(" PerformanceMonitorInstaller.exe Interactive mode"); + Console.WriteLine(" PerformanceMonitorInstaller.exe [options] Windows Auth"); + Console.WriteLine(" PerformanceMonitorInstaller.exe SQL Auth"); + Console.WriteLine(" PerformanceMonitorInstaller.exe SQL Auth (password via env var)"); + Console.WriteLine(); + Console.WriteLine("Options:"); + Console.WriteLine(" -h, --help Show this help message"); + Console.WriteLine(" --reinstall Drop existing database and perform clean install"); + Console.WriteLine(" --reset-schedule Reset collection schedule to recommended defaults"); + Console.WriteLine(" --encrypt= Connection encryption: mandatory (default), optional, strict"); + Console.WriteLine(" --trust-cert Trust server certificate without validation"); + Console.WriteLine(); + Console.WriteLine("Environment Variables:"); + Console.WriteLine(" PM_SQL_PASSWORD SQL Auth password (avoids passing on command line)"); + Console.WriteLine(); + Console.WriteLine("Exit Codes:"); + Console.WriteLine(" 0 Success"); + Console.WriteLine(" 1 Invalid arguments"); + Console.WriteLine(" 2 Connection failed"); + Console.WriteLine(" 3 Critical file failed"); + Console.WriteLine(" 4 Partial installation (non-critical failures)"); + Console.WriteLine(" 5 Version check failed"); + Console.WriteLine(" 6 SQL files not found"); + return 0; + } + bool automatedMode = args.Length > 0; bool reinstallMode = args.Any(a => a.Equals("--reinstall", StringComparison.OrdinalIgnoreCase)); bool resetSchedule = args.Any(a => a.Equals("--reset-schedule", StringComparison.OrdinalIgnoreCase)); diff --git a/Lite/MainWindow.xaml b/Lite/MainWindow.xaml index 9f257c26..6826ebab 100644 --- a/Lite/MainWindow.xaml +++ b/Lite/MainWindow.xaml @@ -275,11 +275,11 @@ - - - - - + + + + +