]> Dogcows Code - chaz/tar/blobdiff - src/tar.c
Fixed several inconsistencies.
[chaz/tar] / src / tar.c
index 2f393f622fd9d4d8dc9ff0c51c301f93e5a2a0f9..a01b62a60a8bd9abe480c40893941cf7b3ecca78 100644 (file)
--- a/src/tar.c
+++ b/src/tar.c
@@ -128,6 +128,7 @@ static struct fmttab {
   { "star",    STAR_FORMAT },
 #endif
   { "gnu",     GNU_FORMAT },
+  { "pax",     POSIX_FORMAT }, /* An alias for posix */
   { NULL,       0 }
 };
 
@@ -186,7 +187,6 @@ enum
   DELETE_OPTION,
   EXCLUDE_OPTION,
   FORCE_LOCAL_OPTION,
-  FORMAT_OPTION,
   GROUP_OPTION,
   IGNORE_CASE_OPTION,
   IGNORE_FAILED_READ_OPTION,
@@ -248,6 +248,20 @@ The version control may be set with --backup or VERSION_CONTROL, values are:\n\n
   never, simple   always make simple backups\n");
 
 
+/* NOTE:
+
+   Available option letters are DEIJQY and aeqy. Consider the following
+   assignments:
+
+   [For Solaris tar compatibility]
+   e  exit immediately with a nonzero exit status if unexpected errors occur
+   E  use extended headers (--format=posix)
+   [q  alias for --occurrence=1 =/= this would better be used for quiet?]
+   [I  same as T =/= will harm star compatibility]
+   
+   y  per-file gzip compression
+   Y  per-block gzip compression */
+
 static struct argp_option options[] = {
   {NULL, 0, NULL, 0,
    N_("Main operation mode:"), 0},
@@ -303,7 +317,9 @@ static struct argp_option options[] = {
    N_("do not exit with nonzero on unreadable files"), 21 },
   {"occurrence", OCCURRENCE_OPTION, N_("NUMBER"), OPTION_ARG_OPTIONAL,
    N_("process only the NUMth occurrence of each file in the archive. This option is valid only in conjunction with one of the subcommands --delete, --diff, --extract or --list and when a list of files is given either on the command line or via -T option. NUMBER defaults to 1."), 21 },
-
+  {"seek", 'n', NULL, 0,
+   N_("Archive is seekable"), 21 },
+    
   {NULL, 0, NULL, 0,
    N_("Handling of file attributes:"), 30 },
 
@@ -385,7 +401,7 @@ static struct argp_option options[] = {
   {NULL, 0, NULL, 0,
    N_("Archive format selection:"), 60 },
   
-  {"format", FORMAT_OPTION, N_("FORMAT"), 0,
+  {"format", 'H', N_("FORMAT"), 0,
    N_("create archive of the given format."), 61 },
 
   {"", 0, NULL, OPTION_DOC, N_("FORMAT is one of the following:"), 62},
@@ -548,7 +564,8 @@ set_subcommand_option (enum subcommand subcommand)
 static void
 set_use_compress_program_option (const char *string)
 {
-  if (use_compress_program_option && strcmp (use_compress_program_option, string) != 0)
+  if (use_compress_program_option
+      && strcmp (use_compress_program_option, string) != 0)
     USAGE_ERROR ((0, 0, _("Conflicting compression options")));
 
   use_compress_program_option = string;
@@ -723,6 +740,10 @@ parse_opt(int key, char *arg, struct argp_state *state)
       
       multi_volume_option = true;
       break;
+
+    case 'n':
+      seekable_archive = true;
+      break;
       
 #if !MSDOS
     case 'N':
@@ -897,7 +918,7 @@ parse_opt(int key, char *arg, struct argp_state *state)
       force_local_option = true;
       break;
       
-    case FORMAT_OPTION:
+    case 'H':
       set_archive_format (arg);
       break;
       
@@ -1254,18 +1275,6 @@ find_argp_option (struct argp_option *options, int letter)
   return NULL;
 }
 
-/* FIXME:
-
-   Available option letters are DEHIJQY and aenqy.  Some are reserved:
-
-   e  exit immediately with a nonzero exit status if unexpected errors occur
-   E  use extended headers (draft POSIX headers, that is)
-   I  same as T (for compatibility with Solaris tar)
-   n  the archive is quickly seekable, so don't worry about random seeks
-   q  stop after extracting the first occurrence of the named file
-   y  per-file gzip compression
-   Y  per-block gzip compression */
-
 static void
 decode_options (int argc, char **argv)
 {
This page took 0.026144 seconds and 4 git commands to generate.