Ejemplo n.º 1
0
        private static void Main(string[] args)
        {
            try
            {
                var arg = new Argument();
                arg.Build(args);
                if (arg.Help)
                {
                    PrintHelp();
                    return;
                }

                var getter = new Getter
                    {
                        Uri = arg.Url,
                        Extensions = arg.Extensions,
                        SaveDirectory = arg.SaveDirectory ?? AssemblyDirectory,
                        RecursionDepth = arg.RecursionDepth,
                        ProxyData = arg.ProxyData,
                        UserAgent = arg.UserAgent,
                        GreaterThan = arg.GreaterThan,
                        LessThan = arg.LessThan,
                        RecursionTarget = arg.RecursionTarget,
                        LinkLabel = arg.LinkLabel,
                        NameFilter = arg.NameFilter,
                        RequestTimeout = arg.RequestTimeout
                    };
                getter.Execute();
            }
            catch (ApplicationException ex)
            {
                PrintUsageError(ex.Message);
            }
            catch (Exception ex)
            {
                PrintError(ex.Message);
            }
        }