Пример #1
0
        protected internal override void ProcessOptions(List <string> args)
        {
            CommandFormat cf = new CommandFormat(1, 1, "e", "d", "f", "s", "z");

            cf.Parse(args);
            string[] opts = Collections.ToArray(cf.GetOpts(), new string[0]);
            switch (opts.Length)
            {
            case 0:
            {
                throw new ArgumentException("No test flag given");
            }

            case 1:
            {
                flag = opts[0][0];
                break;
            }

            default:
            {
                throw new ArgumentException("Only one test flag is allowed");
            }
            }
        }