From b0b1c91e8f49470ce6232973f4adb0160a6c021e Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Sat, 14 Oct 2006 15:08:45 +0000 Subject: * Add option to bbackupquery list command to show times in UTC or local time (refs #3) --- bin/bbackupquery/BackupQueries.cpp | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) (limited to 'bin/bbackupquery/BackupQueries.cpp') diff --git a/bin/bbackupquery/BackupQueries.cpp b/bin/bbackupquery/BackupQueries.cpp index 15fabd34..4ab09a3a 100644 --- a/bin/bbackupquery/BackupQueries.cpp +++ b/bin/bbackupquery/BackupQueries.cpp @@ -180,7 +180,7 @@ void BackupQueries::DoCommand(const char *Command) { { "quit", "" }, { "exit", "" }, - { "list", "rodIFtsh", }, + { "list", "rodIFtTsh", }, { "pwd", "" }, { "cd", "od" }, { "lcd", "" }, @@ -350,8 +350,9 @@ void BackupQueries::CommandList(const std::vector &args, const bool #define LIST_OPTION_ALLOWOLD 'o' #define LIST_OPTION_ALLOWDELETED 'd' #define LIST_OPTION_NOOBJECTID 'I' - #define LIST_OPTION_NOFLAGS 'F' - #define LIST_OPTION_TIMES 't' + #define LIST_OPTION_NOFLAGS 'F' + #define LIST_OPTION_TIMES_LOCAL 't' + #define LIST_OPTION_TIMES_UTC 'T' #define LIST_OPTION_SIZEINBLOCKS 's' #define LIST_OPTION_DISPLAY_HASH 'h' @@ -468,11 +469,19 @@ void BackupQueries::List(int64_t DirID, const std::string &rListRoot, const bool } } - if(opts[LIST_OPTION_TIMES]) + if(opts[LIST_OPTION_TIMES_UTC]) { - // Show times... + // Show UTC times... std::string time = BoxTimeToISO8601String( - en->GetModificationTime()); + en->GetModificationTime(), false); + printf("%s ", time.c_str()); + } + + if(opts[LIST_OPTION_TIMES_LOCAL]) + { + // Show local times... + std::string time = BoxTimeToISO8601String( + en->GetModificationTime(), true); printf("%s ", time.c_str()); } -- cgit v1.2.3