Пример #1
0
 public DrainCommand(IApplicationConfiguration applicationConfiguration, IAccessTokenConfiguration accessTokenConfiguration, TextWriter writer)
     : base(applicationConfiguration)
 {
     _accessToken = accessTokenConfiguration.GetAccessToken();
     _restClient = new RestClient(AppHarborBaseUrl);
     _writer = writer;
 }
Пример #2
0
 public DrainCommand(IApplicationConfiguration applicationConfiguration, IAccessTokenConfiguration accessTokenConfiguration, TextWriter writer)
     : base(applicationConfiguration)
 {
     _accessToken = accessTokenConfiguration.GetAccessToken();
     _restClient  = new RestClient(AppHarborBaseUrl);
     _writer      = writer;
 }
        public DeployAppCommand(IApplicationConfiguration applicationConfiguration, IAccessTokenConfiguration accessTokenConfiguration, TextReader reader, TextWriter writer)
            : base(applicationConfiguration)
        {
            _accessToken = accessTokenConfiguration.GetAccessToken();
            _restClient = new RestClient("https://packageclient.apphb.com/");
            _reader = reader;
            _writer = writer;

            _excludedDirectories = new List<string> { ".git", ".hg" };
            OptionSet.Add("e|excluded-directory=", "Add excluded directory name", x => _excludedDirectories.Add(x));
        }
Пример #4
0
        public LogAppCommand(IApplicationConfiguration applicationConfiguration, IAccessTokenConfiguration accessTokenConfiguration, TextWriter writer)
            : base(applicationConfiguration)
        {
            _accessToken    = accessTokenConfiguration.GetAccessToken();
            _writer         = writer;
            _restClient     = new RestClient(AppHarborBaseUrl);
            _assignedColors = new Dictionary <string, ConsoleColor>();

            OptionSet.Add("t|tail", "Tail log", x => _tail = true);
            OptionSet.Add("n|num=", "Number of log messages", (int x) => _limit = x);
            OptionSet.Add("p|process=", "Filter log to this process (case-sensitive)", x => _processFilter = x);
            OptionSet.Add("s|source=", "Filter log to this source", x => _sourceFilter = x);
        }
Пример #5
0
        public LogAppCommand(IApplicationConfiguration applicationConfiguration, IAccessTokenConfiguration accessTokenConfiguration, TextWriter writer)
            : base(applicationConfiguration)
        {
            _accessToken = accessTokenConfiguration.GetAccessToken();
            _writer = writer;
            _restClient = new RestClient(AppHarborBaseUrl);
            _assignedColors = new Dictionary<string, ConsoleColor>();

            OptionSet.Add("t|tail", "Tail log", x => _tail = true);
            OptionSet.Add("n|num=", "Number of log messages", (int x) => _limit = x);
            OptionSet.Add("p|process=", "Filter log to this process (case-sensitive)", x => _processFilter = x);
            OptionSet.Add("s|source=", "Filter log to this source", x => _sourceFilter = x);
        }
Пример #6
0
        public DeployAppCommand(IApplicationConfiguration applicationConfiguration, IAccessTokenConfiguration accessTokenConfiguration, TextReader reader, TextWriter writer)
            : base(applicationConfiguration)
        {
            _accessToken = accessTokenConfiguration.GetAccessToken();
            _restClient = new RestClient(PackageClientBaseUrl);
            _reader = reader;
            _writer = writer;

            _sourceDirectory = new DirectoryInfo(Directory.GetCurrentDirectory());
            OptionSet.Add("source-directory=", "Set source directory", x => _sourceDirectory = new DirectoryInfo(x));

            _excludedDirectories = new List<string> { ".git", ".hg" };
            OptionSet.Add("e|excluded-directory=", "Add excluded directory name", x => _excludedDirectories.Add(x));

            OptionSet.Add("m|message=", "Specify commit message", x => _message = x);
        }
Пример #7
0
        public DeployAppCommand(IApplicationConfiguration applicationConfiguration, IAccessTokenConfiguration accessTokenConfiguration, TextReader reader, TextWriter writer)
            : base(applicationConfiguration)
        {
            _accessToken = accessTokenConfiguration.GetAccessToken();
            _restClient  = new RestClient(PackageClientBaseUrl);
            _reader      = reader;
            _writer      = writer;

            _sourceDirectory = new DirectoryInfo(Directory.GetCurrentDirectory());
            OptionSet.Add("source-directory=", "Set source directory", x => _sourceDirectory = new DirectoryInfo(x));

            _excludedDirectories = new List <string> {
                ".git", ".hg"
            };
            OptionSet.Add("e|excluded-directory=", "Add excluded directory name", x => _excludedDirectories.Add(x));

            OptionSet.Add("m|message=", "Specify commit message", x => _message = x);
        }
Пример #8
0
        protected override void InnerExecute(string[] arguments)
        {
            if (_accessTokenConfiguration.GetAccessToken() != null)
            {
                throw new CommandException("You're already logged in. You need to log out (\"logout\") before you can log in again.");
            }

            _writer.Write("Username: "******"Password: "******"Successfully logged in as {0}", username);
        }
Пример #9
0
 public AddDrainCommand(IApplicationConfiguration applicationConfiguration, IAccessTokenConfiguration accessTokenConfiguration)
     : base(applicationConfiguration)
 {
     _accessToken = accessTokenConfiguration.GetAccessToken();
     _restClient = new RestClient(AppHarborBaseUrl);
 }
Пример #10
0
 public RemoveDrainCommand(IApplicationConfiguration applicationConfiguration, IAccessTokenConfiguration accessTokenConfiguration)
     : base(applicationConfiguration)
 {
     _accessToken = accessTokenConfiguration.GetAccessToken();
     _restClient  = new RestClient(AppHarborBaseUrl);
 }