コード例 #1
0
ファイル: PipeServer.cs プロジェクト: hultqvist/Whisper
 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
ファイル: Main.cs プロジェクト: hultqvist/Whisper
        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]);
            }
        }