linux: Move help options to startup script

This commit is contained in:
Hylke Bons 2018-03-17 23:21:12 +00:00
parent 5f6153e8b3
commit 32b46c27fd
3 changed files with 22 additions and 26 deletions

View file

@ -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;

View file

@ -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://<URL> Opens an invite"
echo " --status-icon=[gtk|appindicator] Use a specific statusicon implementation"
;;
*)
mono "@ABS_INSTALL_DIR@/SparkleShare.exe" $1

View file

@ -91,5 +91,8 @@
</Compile>
</ItemGroup>
<ItemGroup />
<ItemGroup>
<None Include="InstallationInfo.Directory.cs.in" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
</Project>