예제 #1
0
        /// <summary>
        /// Parse command line arguments.
        /// </summary>
        /// <param name="def">The command line definition</param>
        /// <param name="args">The arguments passed to the application</param>
        /// <exception cref="CommandLineArgsException">Thrown if there is an error in the arguments passed into the application</exception>
        /// <exception cref="ArgumentException">Thrown if there is an error in the <see cref="SwitchesDefBase"/> instance</exception>
        public static void Parse(SwitchesDefBase def, params string[] args)
        {
            SwitchesParser parser  = new SwitchesParser(def);
            int            nextArg = parser.Parse(args);

            // copy any extra arguments
            if (nextArg < args.Length)
            {
                string[] extraArgs = new string[args.Length - nextArg];
                Array.Copy(args, nextArg, extraArgs, 0, args.Length - nextArg);
                def.SetExtraArguments(extraArgs);
            }
        }
예제 #2
0
		/// <summary>
		/// Parse command line arguments.
		/// </summary>
		/// <param name="def">The command line definition</param>
		/// <param name="args">The arguments passed to the application</param>
		/// <exception cref="CommandLineArgsException">Thrown if there is an error in the arguments passed into the application</exception>
		/// <exception cref="ArgumentException">Thrown if there is an error in the <see cref="SwitchesDefBase"/> instance</exception>
		public static void Parse(SwitchesDefBase def, params string[] args)
		{
			SwitchesParser parser = new SwitchesParser(def);
			int nextArg = parser.Parse(args);
		
			// copy any extra arguments
			if (nextArg < args.Length)
			{
				string[] extraArgs = new string[args.Length - nextArg];
				Array.Copy(args, nextArg, extraArgs, 0, args.Length - nextArg);
				def.SetExtraArguments(extraArgs);
			}
		}
예제 #3
0
		public SwitchCollection(SwitchesDefBase def)
		{
			m_def = def;
		}
예제 #4
0
 /// <summary>
 /// Ctor is private because users should use the static Parse method.
 /// </summary>
 /// <param name="def"></param>
 private SwitchesParser(SwitchesDefBase def)
 {
     m_def = def;
 }
예제 #5
0
 public SwitchCollection(SwitchesDefBase def)
 {
     m_def = def;
 }
예제 #6
0
		/// <summary>
		/// Ctor is private because users should use the static Parse method.
		/// </summary>
		/// <param name="def"></param>
		private SwitchesParser(SwitchesDefBase def)
		{
			m_def = def;
		}