diff --git a/Duplicati/CommandLine/Commands.cs b/Duplicati/CommandLine/Commands.cs index 481d0fc86..2d08bd76d 100644 --- a/Duplicati/CommandLine/Commands.cs +++ b/Duplicati/CommandLine/Commands.cs @@ -554,15 +554,14 @@ namespace Duplicati.CommandLine public static int CreateBugReport(List args, Dictionary options, Library.Utility.IFilter filter) { - if (args.Count != 2) - return PrintWrongNumberOfArguments(args, 2); - // Support for not adding the --auth-username if possible - string dbpath; + string dbpath = null; options.TryGetValue("dbpath", out dbpath); if (string.IsNullOrEmpty(dbpath)) { - dbpath = Library.Main.DatabaseLocator.GetDatabasePath(args[0], new Duplicati.Library.Main.Options(options), false, true); + 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"); @@ -570,8 +569,14 @@ namespace Duplicati.CommandLine } else options["dbpath"] = dbpath; + } - + + if (args.Count == 0) + args = new List(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]);