aboutsummaryrefslogtreecommitdiff
path: root/tests/manifest/driver.cxx
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2023-03-22 13:18:24 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2023-03-23 18:32:37 +0300
commit723a15c5390d0c5eb42f2082fcedb7262e7bc856 (patch)
tree7bef948322e2de710f44943e1e0dd621dc9b0d86 /tests/manifest/driver.cxx
parentc97dba3a4f2af33091112a347e181a5a2edc9914 (diff)
Add package_manifest::effective_type_sub_options()
Diffstat (limited to 'tests/manifest/driver.cxx')
-rw-r--r--tests/manifest/driver.cxx18
1 files changed, 17 insertions, 1 deletions
diff --git a/tests/manifest/driver.cxx b/tests/manifest/driver.cxx
index fb40f7e..bf97c42 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) [-l]
// argv[0] -p [-c] [-i] [-l]
// argv[0] -ec <version>
+// argv[0] -et <type> <name>
// argv[0] -v
//
// In the first form read and parse manifest list from stdin and serialize it
@@ -52,7 +53,10 @@ 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.
+// In the forth form print the effective type and the type sub-options to
+// stdout (one per line) and exit.
+//
+// In the fifth form print the libbpkg version to stdout and exit.
//
int
main (int argc, char* argv[])
@@ -135,6 +139,18 @@ main (int argc, char* argv[])
cout << c << " " << ec << endl;
}
}
+ else if (mode == "-et")
+ {
+ assert (argc == 4);
+
+ optional<string> t (*argv[2] != '\0' ? argv[2] : optional<string> ());
+ package_name n (argv[3]);
+
+ cout << package_manifest::effective_type (t, n) << endl;
+
+ for (const string& so: package_manifest::effective_type_sub_options (t))
+ cout << so << endl;
+ }
else
{
bool long_lines (false);