From f630d9d87c8758269a9b1aeec2db008cbc105b60 Mon Sep 17 00:00:00 2001
From: Carl Worth <cworth@cworth.org>
Date: Tue, 4 Sep 2012 16:48:00 -0700
Subject: [PATCH] trim: Complain if given extraneous arguments.

Previously additional arguments were silently ignored, (which can lead
to confusion if the user expects to be able to specify a bare callset
on the command line rather than specifying a --calls option).
---
 cli/cli_trim.cpp | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/cli/cli_trim.cpp b/cli/cli_trim.cpp
index c54565f..75670af 100644
--- a/cli/cli_trim.cpp
+++ b/cli/cli_trim.cpp
@@ -253,6 +253,16 @@ command(int argc, char *argv[])
         return 1;
     }
 
+    if (argc > optind + 1) {
+        std::cerr << "error: extraneous arguments:";
+        for (int i = optind + 1; i < argc; i++) {
+            std::cerr << " " << argv[i];
+        }
+        std::cerr << "\n";
+        usage();
+        return 1;
+    }
+
     return trim_trace(argv[optind], &options);
 }
 
-- 
2.45.2