aboutsummaryrefslogtreecommitdiff
path: root/tests/manifest/driver.cxx
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2021-10-05 18:21:10 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2021-10-07 13:19:36 +0300
commit27c616e238b6891cd0fe4081d614e6b5c1f977bb (patch)
tree8ed3bd9320918b6a25db7f6c5602e7ba0311e4af /tests/manifest/driver.cxx
parent9d54661016b1e3d6ea3a6bc633bd657d25e99122 (diff)
Add repositories manifest header
Diffstat (limited to 'tests/manifest/driver.cxx')
-rw-r--r--tests/manifest/driver.cxx10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/manifest/driver.cxx b/tests/manifest/driver.cxx
index 44b1a79..273dce5 100644
--- a/tests/manifest/driver.cxx
+++ b/tests/manifest/driver.cxx
@@ -23,6 +23,7 @@ using namespace bpkg;
// argv[0] (-pp|-dp|-gp|-pr|-dr|-gr|-s)
// argv[0] -p -c -i
// argv[0] -ec <version>
+// argv[0] -v
//
// In the first form read and parse manifest list from stdin and serialize it
// to stdout. The following options specify the manifest type.
@@ -34,6 +35,7 @@ using namespace bpkg;
// -dr parse dir repository manifest list
// -gr parse git repository manifest list
// -s parse signature manifest
+// -v print the libbpkg version
//
// In the second form read and parse the package manifest from stdin and
// serialize it to stdout.
@@ -47,6 +49,8 @@ using namespace bpkg;
// roundtrip them to stdout together with their effective constraints,
// calculated using version passed as an argument.
//
+// In the forth form print the libbpkg version to stdout and exit.
+//
int
main (int argc, char* argv[])
{
@@ -55,6 +59,12 @@ main (int argc, char* argv[])
cout.exceptions (ios_base::failbit | ios_base::badbit);
+ if (mode == "-v")
+ {
+ cout << standard_version (LIBBPKG_VERSION_STR) << endl;
+ return 0;
+ }
+
manifest_parser p (cin, "stdin");
manifest_serializer s (cout, "stdout");