Пример #1
0
 public static void Run(Repo localRepo)
 {
     Stream stdin = Console.OpenStandardInput ();
     Stream stdout = Console.OpenStandardOutput ();
     PipeServer s = new PipeServer (stdin, stdout, localRepo);
     s.Run ();
 }
Пример #2
0
        public static void Run(Repo localRepo)
        {
            Stream     stdin  = Console.OpenStandardInput();
            Stream     stdout = Console.OpenStandardOutput();
            PipeServer s      = new PipeServer(stdin, stdout, localRepo);

            s.Run();
        }
Пример #3
0
        public static void ParseCommand(string[] args)
        {
            if (args.Length == 0)
            {
                throw new HelpException("Missing command argument");
            }

            KeyStorage keyStorage = KeyStorage.Default;

            switch (args [0].ToLower())
            {
            case "list":
                List.Main(args, keyStorage);
                break;

            case "put":
                Put.Main(args, keyStorage);
                break;

            case "get":
                Get.Main(args, keyStorage);
                break;

            case "keys":
                Keys.Main(args, keyStorage);
                break;

            //Serve a single repo via the pipe
            //Usually via a remote ssh connection
            case "pipe":
                Repo pr = Repo.Create(args [1]);
                PipeServer.Run(pr);
                break;

            //Listen to localhost and serve a single repo
            //Used for debugging
            case "tcp":
                Repo tr = Repo.Create(args [1]);
                TcpServer.Run(tr);
                break;

            case "test":
                Test.Main(args, keyStorage);
                break;

            default:
                throw new HelpException("Unknown command: " + args [0]);
            }
        }