예제 #1
0
        /// <summary>
        /// Creates a new BooleanOption and adds it to the list of accepted options.
        /// </summary>
        /// <param name="shortForm">The optional short form for the option.</param>
        /// <param name="longForm">The long form for the option.</param>
        /// <returns>The newly created Option.</returns>
        /// <exception cref="System.ArgumentNullException">The long form is null.</exception>
        public BooleanOption AddBooleanOption(string shortForm, string longForm)
        {
            if (null == longForm)
            {
                throw new ArgumentNullException("longForm", "The long form is not optional.");
            }

            BooleanOption option = new BooleanOption(shortForm, longForm);

            AddOption((Option)option);
            return(option);
        }
예제 #2
0
        /// <summary>
        /// Creates a new BooleanOption and adds it to the list of accepted options.
        /// </summary>
        /// <param name="shortForm">The optional short form for the option.</param>
        /// <param name="longForm">The long form for the option.</param>
        /// <returns>The newly created Option.</returns>
        /// <exception cref="System.ArgumentNullException">The long form is null.</exception>
        public BooleanOption AddBooleanOption( string shortForm, string longForm )
        {
            if(null == longForm)
                throw new ArgumentNullException("longForm", "The long form is not optional.");

            BooleanOption option = new BooleanOption(shortForm, longForm);
            AddOption((Option)option);
            return option;
        }