aboutsummaryrefslogtreecommitdiffhomepage
path: root/notmuch-restore.c
diff options
context:
space:
mode:
authorGravatar David Bremner <bremner@debian.org>2011-10-21 15:46:54 -0300
committerGravatar David Bremner <bremner@debian.org>2011-10-23 10:27:57 -0300
commit903fe6398693621484315d30bd8d37de4095f4a5 (patch)
treeefd49991a3fcbe5707d0e4668e71c13f3b7225cb /notmuch-restore.c
parenta77d9adcacf001025092087fb6c1d77743cdf699 (diff)
notmuch-restore: check for extra arguments.
We consider it an error to pass more than one file to restore, since extra ones are ignored.
Diffstat (limited to 'notmuch-restore.c')
-rw-r--r--notmuch-restore.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/notmuch-restore.c b/notmuch-restore.c
index 75bc09a6..ff1ebab1 100644
--- a/notmuch-restore.c
+++ b/notmuch-restore.c
@@ -77,6 +77,13 @@ notmuch_restore_command (unused (void *ctx), int argc, char *argv[])
optind++;
}
+ if (optind < argc) {
+ fprintf (stderr,
+ "Cannot read dump from more than one file: %s\n",
+ argv[optind]);
+ return 1;
+ }
+
/* Dump output is one line per message. We match a sequence of
* non-space characters for the message-id, then one or more
* spaces, then a list of space-separated tags as a sequence of