Exemple #1
0
        public InputData Read(string[] args)
        {
            var input = new InputData();

            if (!IsInputValid(args))
            {
                throw new SyncException("Input is invalid");
            }

            int count = 0;

            while (_pathChecker.IsValid(args[count]))
            {
                input.FoldersPaths.Add(args[count]);
                count++;
            }

            var flagList = new List <string>();

            while (count < args.Length)
            {
                flagList.Add(args[count]);
                count++;
            }

            if (flagList.Contains(_noDelete))
            {
                input.NoDeleteFlag = true;
            }

            if (flagList.Contains(_loglevel))
            {
                input.LogLevel = GetLogFlag(flagList);
            }

            return(input);
        }