Exemple #1
0
        public static int CreateBugReport(List <string> args, Dictionary <string, string> options, Library.Utility.IFilter filter)
        {
            // Support for not adding the --auth-username if possible
            string dbpath = null;

            options.TryGetValue("dbpath", out dbpath);
            if (string.IsNullOrEmpty(dbpath))
            {
                if (args.Count > 0)
                {
                    dbpath = Library.Main.DatabaseLocator.GetDatabasePath(args[0], new Duplicati.Library.Main.Options(options), false, true);
                }

                if (dbpath == null)
                {
                    Console.WriteLine("No local database found, please add --{0}", "dbpath");
                    return(100);
                }
                else
                {
                    options["dbpath"] = dbpath;
                }
            }

            if (args.Count == 0)
            {
                args = new List <string>(new string[] { "file://unused", "report" });
            }
            else if (args.Count == 1)
            {
                args.Add("report");
            }

            using (var i = new Library.Main.Controller(args[0], options, new ConsoleOutput(options)))
                i.CreateLogDatabase(args[1]);

            Console.WriteLine("Completed!");
            Console.WriteLine();
            Console.WriteLine("Please examine the log table of the database to see that no filenames are accidentially left over.");
            Console.WriteLine("If you are concerned that your filenames may contain sensitive information,");
            Console.WriteLine(" do not attach the database to an issue!!!");
            Console.WriteLine();

            return(0);
        }
Exemple #2
0
        public static int CreateBugReport(List<string> args, Dictionary<string, string> options, Library.Utility.IFilter filter)
        {
            // Support for not adding the --auth-username if possible
            string dbpath = null;
            options.TryGetValue("dbpath", out dbpath);
            if (string.IsNullOrEmpty(dbpath))
            {
                if (args.Count > 0)
                    dbpath = Library.Main.DatabaseLocator.GetDatabasePath(args[0], new Duplicati.Library.Main.Options(options), false, true);
                    
                if (dbpath == null)
                {
                    Console.WriteLine("No local database found, please add --{0}", "dbpath");
                    return 100;
                }
                else
                    options["dbpath"] = dbpath;
                    
            }
            
            if (args.Count == 0)
                args = new List<string>(new string[] { "file://unused", "report" });
            else if (args.Count == 1)
                args.Add("report");
            
            using(var i = new Library.Main.Controller(args[0], options, new ConsoleOutput(options)))
                i.CreateLogDatabase(args[1]);

            Console.WriteLine("Completed!");
            Console.WriteLine();
            Console.WriteLine("Please examine the log table of the database to see that no filenames are accidentially left over.");
            Console.WriteLine("If you are concerned that your filenames may contain sensitive information,");
            Console.WriteLine(" do not attach the database to an issue!!!");
            Console.WriteLine();

            return 0;
        }