Remove --copy, do it whenever we have -o
authornorly <ny-git@enpas.org>
Fri, 22 Feb 2013 16:51:58 +0000 (16:51 +0000)
committernorly <ny-git@enpas.org>
Fri, 22 Feb 2013 16:51:58 +0000 (16:51 +0000)
include/options.h
src/main.c
src/options.c

index c43c811a5ae0e5c61d754735a93bc731f7cdc490..f39f01e8de9858f0914af2e78ea325aa7ae65bdd 100644 (file)
@@ -8,7 +8,6 @@ typedef struct {
   int printHeader;
   int printSegments;
   int printSections;
-  int copy;
 } CLIOpts;
 
 
index bd6d294c021bb61f87b4287ecaab178fe5ec661d..68becadf0beb7319a807b2be510e3af389a35a6b 100644 (file)
@@ -59,26 +59,20 @@ int main(int argc, char **argv)
   }
 
 
-  /* Copy the input ELF to the output file */
-  if (!opts.fnOutput) {
-    if (opts.copy) {
-      fprintf(stderr, "Error: Missing output file name for requested operation.\n");
-    }
-  } else {
-    if (opts.copy) {
-      ElfuElf *me;
+  /* Copy the input ELF to the output file if the latter is specified */
+  if (opts.fnOutput) {
+    ElfuElf *me;
 
-      me = elfu_modelFromElf(hIn.e);
+    me = elfu_modelFromElf(hIn.e);
 
-      if (me) {
-        printf("Model successfully loaded.\n");
+    if (me) {
+      printf("Model successfully loaded.\n");
 
-        elfu_modelToElf(me, hOut.e);
+      elfu_modelToElf(me, hOut.e);
 
-        printf("Model converted to ELF, ready to be written.\n");
-      } else {
-        printf("Failed to load model.\n");
-      }
+      printf("Model converted to ELF, ready to be written.\n");
+    } else {
+      printf("Failed to load model.\n");
     }
   }
 
index 3975bada10e3d12215d3b63974fe2b72f524da74..1b258fe3e86736b3fe8448caf29869fb8777e3dc 100644 (file)
@@ -18,7 +18,6 @@ static void printUsage(char *progname)
           "      --print-segments       Print program headers\n"
           "      --print-sections       Print sections\n"
           "\n"
-          "      --copy                 Copy input to output\n"
           "\n");
 }
 
@@ -36,7 +35,6 @@ void parseOptions(CLIOpts *opts, int argc, char **argv)
     {"print-header", 0, 0, 10001},
     {"print-segments", 0, 0, 10002},
     {"print-sections", 0, 0, 10003},
-    {"copy", 0, 0, 10004},
     {NULL, 0, NULL, 0}
   };
 
@@ -58,9 +56,6 @@ void parseOptions(CLIOpts *opts, int argc, char **argv)
       case 10003:
         opts->printSections = 1;
         break;
-      case 10004:
-        opts->copy = 1;
-        break;
       case '?':
       default:
         goto USAGE;