Beispiel #1
0
        public OptionGroup GetOptionGroup(Option opt)
        {
            OptionGroup group;

            if (optionGroups.TryGetValue(opt.Key(), out group))
            {
                return(group);
            }

            return(null);
        }
Beispiel #2
0
        public Options AddOption(Option option)
        {
            String key = option.Key();

            // add it to the long option list
            if (option.HasLongName()) {
                longOpts[option.LongName] = option;
            }

            // if the option is required add it to the required list
            if (option.IsRequired) {
                if (requiredOpts.Contains(key)) {
                    requiredOpts.RemoveAt(requiredOpts.IndexOf(key));
                }
                requiredOpts.Add(key);
            }

            shortOpts[key] = option;

            return this;
        }
Beispiel #3
0
        public Options AddOption(Option option)
        {
            String key = option.Key();

            // add it to the long option list
            if (option.HasLongName())
            {
                longOpts[option.LongName] = option;
            }

            // if the option is required add it to the required list
            if (option.IsRequired)
            {
                if (requiredOpts.Contains(key))
                {
                    requiredOpts.RemoveAt(requiredOpts.IndexOf(key));
                }
                requiredOpts.Add(key);
            }

            shortOpts[key] = option;

            return(this);
        }
Beispiel #4
0
        public OptionGroup GetOptionGroup(Option opt)
        {
            OptionGroup group;
            if (optionGroups.TryGetValue(opt.Key(), out group))
                return group;

            return null;
        }