Exemple #1
0
        public bool Execute(string subject, IQueueTools tools, IOutput log)
        {
            bool alreadyExists = tools.Exists(subject);

            if (!alreadyExists)
            {
                log.Error(subject, "Doesn't exist.");
                return false;
            }

            log.OK(subject, string.Format("{0} message(s).", tools.Count(subject)));
            return true;
        }
Exemple #2
0
        public bool Execute(string subject, IQueueTools tools, IOutput log)
        {
            bool alreadyExists = tools.Exists(subject);

            if (!alreadyExists)
            {
                log.Error(subject, "Doesn't exist.");
                return(false);
            }

            log.OK(subject, string.Format("{0} message(s).", tools.Count(subject)));
            return(true);
        }
Exemple #3
0
        public bool Execute(string subject, IQueueTools tools, IOutput log)
        {
            bool alreadyExists = tools.Exists(subject);

            if (!alreadyExists)
            {
                log.Warn(subject, "Doesn't exist, nothing to truncate.");
                return(false);
            }

            tools.DeleteAllMessages(subject);
            log.OK(subject, "Truncated.");

            return(true);
        }
Exemple #4
0
        public bool Execute(string subject, IQueueTools tools, IOutput log)
        {
            bool alreadyExists = tools.Exists(subject);

            if (!alreadyExists)
            {
                log.Warn(subject, "Doesn't exist, nothing to truncate.");
                return false;
            }

            tools.DeleteAllMessages(subject);
            log.OK(subject, "Truncated.");

            return true;
        }
Exemple #5
0
        public bool Execute(string subject, IQueueTools tools, IOutput log)
        {
            bool alreadyExists = tools.Exists(subject);

            if (!alreadyExists)
            {
                log.Warn(subject, "Does not exist.");
                return true;
            }

            tools.Delete(subject);
            log.OK(subject, "Deleted.");

            return true;
        }
Exemple #6
0
        public bool Execute(string subject, IQueueTools tools, IOutput log)
        {
            bool alreadyExists = tools.Exists(subject);

            if (!alreadyExists)
            {
                log.Warn(subject, "Does not exist.");
                return(true);
            }

            tools.Delete(subject);
            log.OK(subject, "Deleted.");

            return(true);
        }
Exemple #7
0
        public bool Execute(string subject, IQueueTools tools, IOutput log)
        {
            bool alreadyExists = tools.Exists(subject);

            if (!alreadyExists)
            {
                log.Warn(subject, "Doesn't exist. Skipping.");
                return(false);
            }

            log.Info(subject, "Listing results.");
            foreach (var res in tools.Cat(subject, _opts.WithExtension))
            {
                log.Out(res.ToString());
            }

            return(true);
        }
Exemple #8
0
        public bool Execute(string subject, IQueueTools tools, IOutput log)
        {
            bool alreadyExists = tools.Exists(subject);

            if (!alreadyExists)
            {
                log.Warn(subject, "Doesn't exist. Skipping.");
                return false;
            }

            log.Info(subject, "Listing results.");
            foreach(var res in tools.Grep(subject, _opts.Expression, _opts.CaseInsensitive))
            {
                log.Out(res.ToString());
            }

            return true;
        }
Exemple #9
0
        public bool Execute(string subject, IQueueTools tools, IOutput log)
        {
            bool alreadyExists = tools.Exists(subject);

            if (alreadyExists && !_opts.Force)
            {
                log.Error(subject, "Already exists. Issue -f to force creation.");
                return false;
            }

            if (alreadyExists && _opts.Force)
            {
                tools.Delete(subject);
                log.Warn(subject, "Deleted (force).");
            }

            tools.Create(subject, _opts.User, _opts.Permissions, _opts.Transactional,
                        _opts.Limit);

            log.OK(subject, "Created.");
            return true;
        }
Exemple #10
0
        public bool Execute(string subject, IQueueTools tools, IOutput log)
        {
            bool alreadyExists = tools.Exists(subject);

            if (alreadyExists && !_opts.Force)
            {
                log.Error(subject, "Already exists. Issue -f to force creation.");
                return(false);
            }

            if (alreadyExists && _opts.Force)
            {
                tools.Delete(subject);
                log.Warn(subject, "Deleted (force).");
            }

            tools.Create(subject, _opts.User, _opts.Permissions, _opts.Transactional,
                         _opts.Limit);

            log.OK(subject, "Created.");
            return(true);
        }