mirror of
https://git.notmuchmail.org/git/notmuch
synced 2024-12-22 09:24:54 +01:00
notmuch-restore: check for extra arguments.
We consider it an error to pass more than one file to restore, since extra ones are ignored.
This commit is contained in:
parent
a77d9adcac
commit
903fe63986
2 changed files with 7 additions and 1 deletions
|
@ -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
|
||||
|
|
|
@ -50,7 +50,6 @@ test_expect_success 'Restore with nothing to do, III' \
|
|||
test_cmp dump.expected dump.actual'
|
||||
|
||||
# notmuch restore currently only considers the first argument.
|
||||
test_subtest_known_broken
|
||||
test_expect_success 'Invalid restore invocation' \
|
||||
'test_must_fail notmuch restore dump.expected another_one'
|
||||
|
||||
|
|
Loading…
Reference in a new issue