New option --full-time.

* src/common.h (full_time_option): New global.
* src/tar.c (FULL_TIME_OPTION): New constant.
(options): New option --full-time.
(parse_opt): Handle the --full-time option.
* src/list.c (simple_print_header): Pass full_time_option
as the 2nd argument to tartime.
* doc/tar.texi: Update.
* NEWS: Update.
This commit is contained in:
Sergey Poznyakoff
2010-03-28 12:26:37 +03:00
parent 2981fcc5cb
commit fc61c17410
5 changed files with 46 additions and 8 deletions
+2
View File
@@ -105,6 +105,8 @@ GLOBAL bool absolute_names_option;
/* Display file times in UTC */
GLOBAL bool utc_option;
/* Output file timestamps to the full resolution */
GLOBAL bool full_time_option;
/* This variable tells how to interpret newer_mtime_option, below. If zero,
files get archived if their mtime is not less than newer_mtime_option.
+1 -1
View File
@@ -1146,7 +1146,7 @@ simple_print_header (struct tar_stat_info *st, union block *blk,
/* Time stamp. */
time_stamp = tartime (st->mtime, false);
time_stamp = tartime (st->mtime, full_time_option);
time_stamp_len = strlen (time_stamp);
if (datewidth < time_stamp_len)
datewidth = time_stamp_len;
+8 -1
View File
@@ -274,6 +274,7 @@ enum
EXCLUDE_TAG_ALL_OPTION,
EXCLUDE_VCS_OPTION,
FORCE_LOCAL_OPTION,
FULL_TIME_OPTION,
GROUP_OPTION,
IGNORE_CASE_OPTION,
IGNORE_COMMAND_ERROR_OPTION,
@@ -752,7 +753,9 @@ static struct argp_option options[] = {
"Allowed signals are: SIGHUP, SIGQUIT, SIGINT, SIGUSR1 and SIGUSR2; "
"the names without SIG prefix are also accepted"), GRID+1 },
{"utc", UTC_OPTION, 0, 0,
N_("print file modification dates in UTC"), GRID+1 },
N_("print file modification times in UTC"), GRID+1 },
{"full-time", FULL_TIME_OPTION, 0, 0,
N_("print file time to its full resolution"), GRID+1 },
{"index-file", INDEX_FILE_OPTION, N_("FILE"), 0,
N_("send verbose output to FILE"), GRID+1 },
{"block-number", 'R', 0, 0,
@@ -1437,6 +1440,10 @@ parse_opt (int key, char *arg, struct argp_state *state)
info_script_option = arg;
multi_volume_option = true;
break;
case FULL_TIME_OPTION:
full_time_option = true;
break;
case 'g':
listed_incremental_option = arg;