Esempio n. 1
0
        public static CommandLineArgs ResultsInstance()
        {
            if (_commandLineArgs == null)
            {
                _commandLineArgs = CommandLineArgs.Create(new List <string>(), new List <string>(), new List <string>());
            }

            return(_commandLineArgs);
        }
Esempio n. 2
0
        public bool Parse(string[] args)
        {
            var argsList = new List <string>(args);

            if (IsHelpSwitch(argsList))
            {
                return(false);
            }
            else if (!IsValidSwitches(argsList))
            {
                throw new ArgumentException("invalid switch(es) used.");
            }

            argsList.Add(SWITCH_TOKEN);
            var folders        = GetArgsOf(FOLDER_SWITCH, argsList, ValidateFolders);
            var treeFolders    = GetArgsOf(FOLDER_TREE_SWITCH, argsList, ValidateFolders);
            var searchPatterns = GetArgsOf(SEARCH_PATTERN_SWITCH, argsList, ValidateSearchPattern);

            _commandLineArgs = CommandLineArgs.Create(folders, treeFolders, searchPatterns);

            return(true);
        }