summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2025-03-03 00:09:01 +0100
committerCarl Hetherington <cth@carlh.net>2025-03-08 00:12:07 +0100
commit3be10e6264ee8a817c4b6ed744a2a34cf99cecea (patch)
treeef4afdd0e4d9ca8fb1eecc0abf1b380a2f6c5132 /src
parentf190ce5af38c87b2586cff0b49d6be0bb38f5b0d (diff)
Add a basic test of the encode CLI.
Diffstat (limited to 'src')
-rw-r--r--src/lib/encode_cli.cc3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/lib/encode_cli.cc b/src/lib/encode_cli.cc
index 6209d4c01..d7c4541cb 100644
--- a/src/lib/encode_cli.cc
+++ b/src/lib/encode_cli.cc
@@ -271,6 +271,9 @@ encode_cli(int argc, char* argv[], function<void (string)> out, function<void ()
optional<boost::filesystem::path> export_filename;
bool hints = false;
+ /* This makes it possible to call getopt several times in the same executable, for tests */
+ optind = 0;
+
int option_index = 0;
while (true) {
static struct option long_options[] = {