Exemplo n.º 1
0
        static void Main(string[] args)
        {
            var options = new ComLineOptions();

            if (!CommandLine.Parser.Default.ParseArguments(args, options)) {
                return;
            }

            options.Validate();
            if ( options.Messages.Count() > 0 ) {
                foreach (var m in options.Messages) {
                    Console.WriteLine(m.Message);
                }
                if ( !options.IsValid )
                    return;
            }

            if ( !options.UseTrustedConnexion && String.IsNullOrEmpty(options.Password) ) {
                Console.Write("Password: "******"*");
                    }
                    else {
                        if (key.Key == ConsoleKey.Backspace && options.Password.Length > 0) {
                            options.Password = options.Password.Substring(0, (options.Password.Length - 1));
                            Console.Write("\b \b");
                        }
                    }
                } while (key.Key != ConsoleKey.Enter);
                Console.WriteLine ();
            }

            try {
                BaseTool bt = null;
                switch ( options.Tool) {
                    case Tools.LineComp:
                        bt = new LineCompTool(options);
                        break;
                    case Tools.SearchFields:
                        bt = new SearchFieldsTool(options);
                        break;
                    default:
                        break;
                }
                if ( bt != null ) {
                    bt.Action();
                }
            } catch (Exception ex) {
                while (ex != null) {
                    Console.WriteLine(ex.Message);
                    ex = ex.InnerException;
                }
            }
        }
Exemplo n.º 2
0
 public LineCompTool(ComLineOptions opts)
     : base(opts)
 {
 }
Exemplo n.º 3
0
 public BaseTool(ComLineOptions opts)
 {
     _opts = opts;
 }
Exemplo n.º 4
0
 public SearchFieldsTool(ComLineOptions opts)
     : base(opts)
 {
 }