Exemplo n.º 1
0
        public static IList <ComandoTO> ObtenerComandos(string argumentosCLI, out int stopIndex, int startIndex = 0)
        {
            IList <ComandoTO> retorno = new List <ComandoTO>();

            stopIndex = startIndex;

            string nombreComando = null;

            for (int i = startIndex; i < argumentosCLI.Length; i++)
            {
                nombreComando = ObtenerValor(argumentosCLI, out stopIndex, i, ' ');

                ComandoTO comando = new ComandoTO();
                comando.Nombre = nombreComando;

                comando.Propiedades = ObtenerPropiedades(argumentosCLI, out stopIndex, stopIndex + 1);
                comando.Argumentos  = ArgumentoTO.ToArgumentos(ObtenerArgumentos(argumentosCLI, out stopIndex, stopIndex));

                comando.Argumentos.Concat(ConsoledProgram.ArgumentosComunes);
                comando.Propiedades.Concat(ConsoledProgram.PropiedadesComunes);

                retorno.Add(comando);
                i = stopIndex - 1;
            }

            return(retorno);
        }
Exemplo n.º 2
0
        public static void CargarArgumentosConsola(string[] args)
        {
            ArgumentosCLI = Unir(args);

            int stopIndex = 0;

            ArgumentosComunes  = ArgumentoTO.ToArgumentos(ArgumentUtil.ObtenerArgumentos(ArgumentosCLI, out stopIndex, 0));
            PropiedadesComunes = ArgumentUtil.ObtenerPropiedades(ArgumentosCLI, out stopIndex, stopIndex);
            Comandos           = ArgumentUtil.ObtenerComandos(ArgumentosCLI, out stopIndex, stopIndex);
        }