From 1b69daf1e621fde42afa5269fb8bfb7066c83862 Mon Sep 17 00:00:00 2001 From: Hylke Bons Date: Tue, 27 Apr 2010 21:33:44 +0100 Subject: [PATCH] Add command line argument --- src/SparklePony.cs | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/src/SparklePony.cs b/src/SparklePony.cs index 92d99a18..fed0ebb9 100644 --- a/src/SparklePony.cs +++ b/src/SparklePony.cs @@ -45,21 +45,31 @@ public class SparklePony { bool HideUI = false; if (args.Length > 0) { foreach (string Argument in args) { - if (Argument.Equals ("--disable-gui")) { + if (Argument.Equals ("--disable-gui") || Argument.Equals ("-d")) HideUI = true; + if (Argument.Equals ("--help") || Argument.Equals ("-h")) { + ShowHelp (); } } - } - - Gtk.Application.Init (); SparklePonyUI SparklePonyUI = new SparklePonyUI (HideUI); SparklePonyUI.StartMonitoring (); Gtk.Application.Run (); } + public static void ShowHelp () { + Console.WriteLine ("Usage: mono SparklePony.exe [OPTION]..."); + Console.WriteLine ("Sync Collaboration folder with remote repositories."); + Console.WriteLine (""); + Console.WriteLine ("Arguments:"); + Console.WriteLine ("\t -d, --disable-gui\tDon't show the notification icon."); + Console.WriteLine ("\t -h, --help\t\tDisplay this help text."); + Console.WriteLine (""); + Environment.Exit (0); + } + } public class SparklePonyUI {