Ejemplo n.º 1
0
        // See if the given commandLine starts with a valid environment name. If so,
        // extract the environment name from the front and return the remainder of the
        // commandline.
        private (string startingEnvironment, string commandLine) GetStartingEnvironment(string commandLine)
        {
            var validEnvironments = Environments.GetNames();

            if (validEnvironments.Count <= 1)
            {
                return(null, commandLine);
            }

            var parts = commandLine.Split(new[] { ' ' }, 2);
            var env   = parts[0];

            return(Environments.IsValid(env) ? (env, parts[1]) : (null, commandLine));