Exemplo n.º 1
0
        public void Execute()
        {
            // Some messages, especially internal ones, don't want to display in headless
            if (_args.HasFlag("noheadless") && _state.Headless)
            {
                return;
            }

            var output    = _output;
            var colorName = _args.Get("color").AsString();

            if (!string.IsNullOrEmpty(colorName))
            {
                var color = (ConsoleColor)Enum.Parse(typeof(ConsoleColor), colorName);
                output = output.Color(color);
            }

            var strings = _args.GetAllPositionals().Where(p => p.Exists()).Select(p => p.AsString());
            var line    = string.Join(" ", strings);

            if (_args.HasFlag("nonewline"))
            {
                output.Write(line);
            }
            else
            {
                output.WriteLine(line);
            }
        }
Exemplo n.º 2
0
        public void Execute()
        {
            var libraries = _environment.Libraries;
            var libArg    = _args.Shift();

            if (libArg.Exists())
            {
                libraries = new[] { libArg.Value }
            }
            ;
            var major = _args.HasFlag("major");
            var minor = _args.HasFlag("minor");

            BumpVersions(libraries, major, minor);
        }
Exemplo n.º 3
0
        public void Execute()
        {
            if (_args.HasFlag("notset"))
            {
                if (_environments.Current != null)
                {
                    return;
                }
                ChangeEnvironment();
                return;
            }
            if (_args.HasFlag("list"))
            {
                ListEnvironments();
                return;
            }

            // Otherwise we're switching environments
            ChangeEnvironment();
        }
Exemplo n.º 4
0
        public void Execute()
        {
            var arg = _args.Shift();

            if (arg.Exists())
            {
                GetDetail(arg.Value);
                return;
            }

            var showAll = _args.HasFlag("showall");

            GetOverview(showAll);
        }
Exemplo n.º 5
0
 public void Execute()
 {
     _output.WriteLine(_args.Get(0).AsString());
     _output.WriteLine(_args.Get("b").AsString());
     _output.WriteLine(_args.HasFlag("c").ToString());
 }