2016-07-05 20:22:34 +00:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
|
|
|
|
namespace GalleryShare
|
|
|
|
|
{
|
|
|
|
|
class MainClass
|
|
|
|
|
{
|
|
|
|
|
public static int Main(string[] args)
|
|
|
|
|
{
|
2016-07-06 18:20:05 +00:00
|
|
|
|
string directory = Environment.CurrentDirectory;
|
2016-07-05 20:22:34 +00:00
|
|
|
|
int port = 3333;
|
|
|
|
|
List<string> extras = new List<string>();
|
|
|
|
|
for(int i = 0; i < args.Length; i++)
|
|
|
|
|
{
|
|
|
|
|
if (!args[i].StartsWith("-"))
|
|
|
|
|
{
|
|
|
|
|
extras.Add(args[i]);
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
string trimmedArg = args[i].Trim('-');
|
|
|
|
|
switch (trimmedArg)
|
|
|
|
|
{
|
|
|
|
|
case "port":
|
|
|
|
|
case "p":
|
|
|
|
|
port = int.Parse(args[++i]);
|
|
|
|
|
break;
|
2016-07-06 18:20:05 +00:00
|
|
|
|
|
|
|
|
|
case "d":
|
|
|
|
|
case "directory":
|
|
|
|
|
directory = args[++i];
|
|
|
|
|
break;
|
|
|
|
|
|
2016-07-05 20:22:34 +00:00
|
|
|
|
default:
|
|
|
|
|
Console.Error.WriteLine("Error: Unknown argument '{0}'.", args[i]);
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2016-07-06 18:20:05 +00:00
|
|
|
|
GalleryServer gserver = new GalleryServer(directory, port);
|
2016-07-05 20:22:34 +00:00
|
|
|
|
gserver.StartSync();
|
|
|
|
|
|
|
|
|
|
return 255;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|