]> Dogcows Code - chaz/tar/commitdiff
(archive_format_string): Remove static qualifier.
authorSergey Poznyakoff <gray@gnu.org.ua>
Tue, 6 Dec 2005 16:32:37 +0000 (16:32 +0000)
committerSergey Poznyakoff <gray@gnu.org.ua>
Tue, 6 Dec 2005 16:32:37 +0000 (16:32 +0000)
(subcommand_string): New function.

src/tar.c

index d842b854e7f313921eb167d590dc560202a453ef..d20948b269d7ddfacd7a67efd43aebb11a0139e2 100644 (file)
--- a/src/tar.c
+++ b/src/tar.c
@@ -153,7 +153,7 @@ set_archive_format (char const *name)
   archive_format = p->fmt;
 }
 
-static const char *
+const char *
 archive_format_string (enum archive_format fmt)
 {
   struct fmttab const *p;
@@ -174,6 +174,42 @@ assert_format(unsigned fmt_mask)
                  _("GNU features wanted on incompatible archive format")));
 }
 
+const char *
+subcommand_string (enum subcommand c)
+{
+  switch (c)
+    {
+    case UNKNOWN_SUBCOMMAND:
+      return "unknown?";
+
+    case APPEND_SUBCOMMAND:
+      return "-r";
+
+    case CAT_SUBCOMMAND:
+      return "-A";
+      
+    case CREATE_SUBCOMMAND:
+      return "-c";
+      
+    case DELETE_SUBCOMMAND:
+      return "-D";
+
+    case DIFF_SUBCOMMAND:
+      return "-d";
+      
+    case EXTRACT_SUBCOMMAND:
+      return "-x";
+
+    case LIST_SUBCOMMAND:
+      return "-t";
+
+    case UPDATE_SUBCOMMAND:
+      return "-u";
+
+    default:
+      abort ();
+    }
+}
 
 \f
 /* Options.  */
This page took 0.02541 seconds and 4 git commands to generate.