From 32b46c27fdf6e552794fed3d5f086913bc192d4a Mon Sep 17 00:00:00 2001 From: Hylke Bons Date: Sat, 17 Mar 2018 23:21:12 +0000 Subject: [PATCH] linux: Move help options to startup script --- SparkleShare/Common/SparkleShare.cs | 24 ------------------------ SparkleShare/Linux/sparkleshare.in | 21 +++++++++++++++++++-- Sparkles/Sparkles.csproj | 3 +++ 3 files changed, 22 insertions(+), 26 deletions(-) diff --git a/SparkleShare/Common/SparkleShare.cs b/SparkleShare/Common/SparkleShare.cs index 16980e23..8c7aa846 100644 --- a/SparkleShare/Common/SparkleShare.cs +++ b/SparkleShare/Common/SparkleShare.cs @@ -35,14 +35,6 @@ namespace SparkleShare { #endif public static void Main (string [] args) { - if (args.Length != 0 && (args [0].Equals ("help") || args [0].Equals ("version")) && - InstallationInfo.OperatingSystem != OS.macOS && - InstallationInfo.OperatingSystem != OS.Windows) { - - DisplayHelp (); - Environment.Exit (0); - } - // Only allow one instance of SparkleShare (on Windows) if (!program_mutex.WaitOne (0, exitContext: false)) { Console.WriteLine ("SparkleShare is already running."); @@ -65,22 +57,6 @@ namespace SparkleShare { } - static void DisplayHelp () - { - string n = Environment.NewLine; - - Console.WriteLine (n + - "Share and collaborate by syncing with any Git repository instantly." + n + - n + - "Version: " + InstallationInfo.Version + n + - "Copyright (C) 2010 Hylke Bons and others" + n + - "This program comes with ABSOLUTELY NO WARRANTY." + n + - n + - "This is free software, and you are welcome to redistribute it" + n + - "under certain conditions. Please read the GNU GPLv3 for details." + n); - } - - static void OnUnhandledException (object sender, UnhandledExceptionEventArgs exception_args) { var exception = (Exception) exception_args.ExceptionObject; diff --git a/SparkleShare/Linux/sparkleshare.in b/SparkleShare/Linux/sparkleshare.in index 103ffcdd..10214ef4 100755 --- a/SparkleShare/Linux/sparkleshare.in +++ b/SparkleShare/Linux/sparkleshare.in @@ -12,8 +12,25 @@ case $1 in curl --insecure --output ~/SparkleShare/.$invite.xml $open mono "@ABS_INSTALL_DIR@/SparkleShare.exe" ;; - help|--help|version|--version) - mono "@ABS_INSTALL_DIR@/SparkleShare.exe" help + version|--version) + echo @VERSION@ + ;; + help|--help) + echo + echo "Share and collaborate by syncing with any Git repository instantly." + echo + echo "Version: @VERSION@" + echo "Copyright (C) 2010 Hylke Bons and others" + n + + echo "This program comes with ABSOLUTELY NO WARRANTY." + n + + echo + echo "This is free software, and you are welcome to redistribute it" + echo "under certain conditions. Please read the GNU GPLv3 for details." + echo + echo "Usage: sparkelshare [options]" + echo + echo "Options:" + echo " --open sparkleshare:// Opens an invite" + echo " --status-icon=[gtk|appindicator] Use a specific statusicon implementation" ;; *) mono "@ABS_INSTALL_DIR@/SparkleShare.exe" $1 diff --git a/Sparkles/Sparkles.csproj b/Sparkles/Sparkles.csproj index b7cb50a2..e9c3bc99 100644 --- a/Sparkles/Sparkles.csproj +++ b/Sparkles/Sparkles.csproj @@ -91,5 +91,8 @@ + + + \ No newline at end of file