diff --git a/source/app.d b/source/app.d index a79b3f8..d952688 100644 --- a/source/app.d +++ b/source/app.d @@ -237,7 +237,9 @@ int main(string[] args) return EXIT_FAILURE; } catch (Exception e) { writeln( - "AN UNEXPECTED ERROR HAS OCCURRED! PLEASE REPORT IT TO THE AUTHOR OF THE SNAG!\n\n", + "AN UNEXPECTED ERROR HAS OCCURRED!\n", + "PLEASE REPORT IT TO THE AUTHOR OF THE SNAG: ", + "alexander@zhirov.kz (Alexander Zhirov)\n\n", e ); return EXIT_FAILURE; diff --git a/source/snag/core/core.d b/source/snag/core/core.d index 9917240..156d59a 100644 --- a/source/snag/core/core.d +++ b/source/snag/core/core.d @@ -131,7 +131,7 @@ class Snag { } writeln("The following list of files requires backup:"); result.output.split('\n')[0..$-1].map!(e => - e.strip.split + e.strip.splitByFirstSpace ).each!(e => writefln("\t%s\t/%s", gitStatus(e[0], true), e[1]) ); @@ -250,7 +250,7 @@ class Snag { [ "log", "--all", - "--date=format:%Y.%m.%d %H:%M", + "--date=format:%Y.%m.%d %H:%M:%S", "--pretty=" ~ format ], "Failed to retrieve the list of snapshots" diff --git a/source/snag/lib/lib.d b/source/snag/lib/lib.d index 902691d..6db6056 100644 --- a/source/snag/lib/lib.d +++ b/source/snag/lib/lib.d @@ -2,6 +2,8 @@ module snag.lib.lib; import std.regex; import std.process; +import std.algorithm; +import std.string; bool isValidHash(string hash) { auto hashPattern = ctRegex!r"^[a-fA-F0-9]{7}$"; @@ -17,3 +19,9 @@ bool checkGit() { auto result = execute(["which", "git"]); return !result.status; } + +string[] splitByFirstSpace(string line) { + auto spaceIndex = line.indexOf(' '); + return spaceIndex == -1 ? + [line] : [line[0 .. spaceIndex], line[spaceIndex + 1..$]]; +}