예제 #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="HTTPServer.CLFlag"/> class.
 /// </summary>
 /// <param name="flag">Flag.</param>
 /// <param name="callback">Callback.</param>
 public CLFlag(string flag, FlagCallback callback)
 {
     Flag = flag;
     Callback = callback;
 }
예제 #2
0
        /// <summary>
        /// Registers a new flag.
        /// </summary>
        private void registerFlag(string flag, FlagCallback callback)
        {
            if (Flags.ContainsKey(flag))
            {
                Console.Error.WriteLine("Flag '" + flag + "' already exists, you're overriding it");
            }
            if (flag[0] == '-')
            {
                Console.Error.WriteLine("Attempting to register flag: " + flag + "with explicit preceding dash");
            }

            Flags.Add("-" + flag, new CLFlag(flag, callback));
        }