]> Dogcows Code - chaz/tar/blobdiff - src/tar.c
New option --full-time.
[chaz/tar] / src / tar.c
index 170871593f2754655b247d279c062b602f8214a8..21c396d56601ca0c0ed9e2edd497a457bea14610 100644 (file)
--- a/src/tar.c
+++ b/src/tar.c
@@ -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,
@@ -281,6 +282,7 @@ enum
   INDEX_FILE_OPTION,
   KEEP_NEWER_FILES_OPTION,
   LEVEL_OPTION,
+  LZIP_OPTION,
   LZMA_OPTION,
   LZOP_OPTION,
   MODE_OPTION,
@@ -624,6 +626,7 @@ static struct argp_option options[] = {
   {"ungzip", 0, 0, OPTION_ALIAS, NULL, GRID+1 },
   {"compress", 'Z', 0, 0, NULL, GRID+1 },
   {"uncompress", 0, 0, OPTION_ALIAS, NULL, GRID+1 },
+  {"lzip", LZIP_OPTION, 0, 0, NULL, GRID+1 },
   {"lzma", LZMA_OPTION, 0, 0, NULL, GRID+1 },
   {"lzop", LZOP_OPTION, 0, 0, NULL, GRID+1 },
   {"xz", 'J', 0, 0, NULL, GRID+1 },
@@ -750,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,
@@ -1252,7 +1257,7 @@ tar_help_filter (int key, const char *text, void *input)
 {
   struct obstack stk;
   char *s;
-
+  
   switch (key)
     {
     default:
@@ -1271,6 +1276,10 @@ tar_help_filter (int key, const char *text, void *input)
       s = xasprintf (_("filter the archive through %s"), COMPRESS_PROGRAM);
       break;
 
+    case LZIP_OPTION:
+      s = xasprintf (_("filter the archive through %s"), LZIP_PROGRAM);
+      break;
+      
     case LZMA_OPTION:
       s = xasprintf (_("filter the archive through %s"), LZMA_PROGRAM);
       break;
@@ -1280,19 +1289,23 @@ tar_help_filter (int key, const char *text, void *input)
       break;
       
     case ARGP_KEY_HELP_EXTRA:
-      obstack_init (&stk);
-      s = _("Valid arguments for the --quoting-style option are:");
-      obstack_grow (&stk, s, strlen (s));
-      obstack_grow (&stk, "\n\n", 2);
-      tar_list_quoting_styles (&stk, "  ");
-      s = _("\n*This* tar defaults to:\n");
-      obstack_grow (&stk, s, strlen (s));
-      s = format_default_settings ();
-      obstack_grow (&stk, s, strlen (s));
-      obstack_1grow (&stk, '\n');
-      obstack_1grow (&stk, 0);
-      s = xstrdup (obstack_finish (&stk));
-      obstack_free (&stk, NULL);
+      {
+       const char *tstr;
+
+       obstack_init (&stk);
+       tstr = _("Valid arguments for the --quoting-style option are:");
+       obstack_grow (&stk, tstr, strlen (tstr));
+       obstack_grow (&stk, "\n\n", 2);
+       tar_list_quoting_styles (&stk, "  ");
+       tstr = _("\n*This* tar defaults to:\n");
+       obstack_grow (&stk, tstr, strlen (tstr));
+       s = format_default_settings ();
+       obstack_grow (&stk, s, strlen (s));
+       obstack_1grow (&stk, '\n');
+       obstack_1grow (&stk, 0);
+       s = xstrdup (obstack_finish (&stk));
+       obstack_free (&stk, NULL);
+      }
     }
   return s;
 }
@@ -1427,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;
@@ -1506,6 +1523,10 @@ parse_opt (int key, char *arg, struct argp_state *state)
       }
       break;
       
+    case LZIP_OPTION:
+      set_use_compress_program_option (LZIP_PROGRAM);
+      break;
+      
     case LZMA_OPTION:
       set_use_compress_program_option (LZMA_PROGRAM);
       break;
@@ -2556,8 +2577,6 @@ main (int argc, char **argv)
 
   obstack_init (&argv_stk);
 
-  /* Ensure default behavior for some signals */
-  signal (SIGPIPE, SIG_IGN);
   /* System V fork+wait does not work if SIGCHLD is ignored.  */
   signal (SIGCHLD, SIG_DFL);
 
This page took 0.028759 seconds and 4 git commands to generate.