|
| 1 | +/* |
| 2 | + * This file is part of TidyBackups |
| 3 | + * |
| 4 | + * TidyBackups is free software: you can redistribute it and/or modify |
| 5 | + * it under the terms of the GNU Lesser General Public License as published by |
| 6 | + * the Free Software Foundation, either version 3 of the License, or |
| 7 | + * (at your option) any later version. |
| 8 | + * |
| 9 | + * TidyBackups is distributed in the hope that it will be useful, |
| 10 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 | + * GNU Lesser General Public License for more details. |
| 13 | + * |
| 14 | + * You should have received a copy of the GNU Lesser General Public License |
| 15 | + * along with TidyBackups. If not, see <http://www.gnu.org/licenses/>. |
| 16 | + */ |
| 17 | + |
| 18 | +using System; |
| 19 | +using TidyBackups; |
| 20 | +using TidyBackups.Item; |
| 21 | + |
| 22 | +namespace TidyBackups.Debug |
| 23 | +{ |
| 24 | + internal class Output |
| 25 | + { |
| 26 | + internal static void Info(string[] args, bool compress, int days, string path, int preserve, bool safe) |
| 27 | + { |
| 28 | + Message.Print(Assembly.Title + " - " + Assembly.Version); |
| 29 | + Message.Print("Admin: " + (object)(bool)(Admin.IsAdmin ? 1 : 0)); |
| 30 | + Message.Print("OS Version: " + Os.Version); |
| 31 | + Message.Print("Disc letter: " + Disc.GetDriveName(path)); |
| 32 | + Message.Print("Disc label: " + Disc.Label(path)); |
| 33 | + Message.Print("Disc format: " + Disc.Format(path)); |
| 34 | + Message.Print("Local disc: " + (object)(bool)(Disc.IsLocalDrive(Disc.GetDriveName(path)) ? 1 : 0)); |
| 35 | + Message.Print("Disc type: " + Disc.Type(path)); |
| 36 | + Message.Print("Disc ready: " + Disc.Ready(path)); |
| 37 | + Message.Print("Disc size: " + Disc.TotalSpace(path)); |
| 38 | + Message.Print("Free space: " + Disc.FreeSpace(path)); |
| 39 | + Message.Print("Username: " + Environment.UserName); |
| 40 | + Message.Print("Domain: " + Environment.UserDomainName); |
| 41 | + Message.Print("Arguments:" + Output.StrArg(args)); |
| 42 | + Message.Print("Days: " + (object)days); |
| 43 | + Message.Print("Path: " + path); |
| 44 | + Files.Filtered(path); |
| 45 | + Message.Print("Path permission: " + Permissions.View(path)); |
| 46 | + Message.Print("Preserve: " + (object)preserve); |
| 47 | + Message.Print("Safe: " + (object)(bool)(safe ? 1 : 0)); |
| 48 | + Message.Print("Archive: " + (object)(bool)(compress ? 1 : 0)); |
| 49 | + bool flag = true; |
| 50 | + if (Message.Logfile == "") |
| 51 | + flag = false; |
| 52 | + Message.Print("Log: " + (object)(bool)(flag ? 1 : 0)); |
| 53 | + if (!flag) |
| 54 | + return; |
| 55 | + Message.Print("Log path: " + Message.Logfile); |
| 56 | + Message.Print("Log permission: " + Permissions.View(Message.Logfile)); |
| 57 | + } |
| 58 | + |
| 59 | + private static string StrArg(string[] args) |
| 60 | + { |
| 61 | + string str1 = ""; |
| 62 | + for (int index = 0; index < args.Length; ++index) |
| 63 | + { |
| 64 | + string str2 = args[index].ToUpper(); |
| 65 | + str1 = str1 + " " + str2; |
| 66 | + } |
| 67 | + return str1; |
| 68 | + } |
| 69 | + } |
| 70 | +} |
0 commit comments