Improved interface for create-report

This commit is contained in:
Kenneth Skovhede
2013-09-25 23:29:35 +02:00
parent 15ff026b1c
commit 87e564e969
+11 -6
View File
@@ -554,15 +554,14 @@ namespace Duplicati.CommandLine
public static int CreateBugReport(List<string> args, Dictionary<string, string> 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<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]);