diff options
author | Karen Arutyunov <karen@codesynthesis.com> | 2021-12-08 22:46:50 +0300 |
---|---|---|
committer | Karen Arutyunov <karen@codesynthesis.com> | 2022-01-14 14:29:01 +0300 |
commit | 6a68b1fd2161357a5905b875e9d59609a2b829b1 (patch) | |
tree | 52f925120b329928d1cdcfeab3e35cd48319928e /tests/manifest/driver.cxx | |
parent | fc5da517f670a7ddf844527bfb3dbb9c9c2d482d (diff) |
Add support for package dependency and requirement alternatives representation new syntax
Diffstat (limited to 'tests/manifest/driver.cxx')
-rw-r--r-- | tests/manifest/driver.cxx | 29 |
1 files changed, 24 insertions, 5 deletions
diff --git a/tests/manifest/driver.cxx b/tests/manifest/driver.cxx index 273dce5..c0d8693 100644 --- a/tests/manifest/driver.cxx +++ b/tests/manifest/driver.cxx @@ -20,8 +20,8 @@ using namespace bpkg; // Usages: // -// argv[0] (-pp|-dp|-gp|-pr|-dr|-gr|-s) -// argv[0] -p -c -i +// argv[0] (-pp|-dp|-gp|-pr|-dr|-gr|-s) [-l] +// argv[0] -p [-c] [-i] [-l] // argv[0] -ec <version> // argv[0] -v // @@ -45,6 +45,9 @@ using namespace bpkg; // // Note: the above options should go after -p on the command line. // +// -l +// Don't break long lines while serializing a manifest. +// // In the third form read and parse dependency constraints from stdin and // roundtrip them to stdout together with their effective constraints, // calculated using version passed as an argument. @@ -65,8 +68,7 @@ main (int argc, char* argv[]) return 0; } - manifest_parser p (cin, "stdin"); - manifest_serializer s (cout, "stdout"); + manifest_parser p (cin, "stdin"); try { @@ -74,6 +76,7 @@ main (int argc, char* argv[]) { bool complete_dependencies (false); bool ignore_unknown (false); + bool long_lines (false); for (int i (2); i != argc; ++i) { @@ -83,10 +86,14 @@ main (int argc, char* argv[]) complete_dependencies = true; else if (o == "-i") ignore_unknown = true; + else if (o == "-l") + long_lines = true; else assert (false); } + manifest_serializer s (cout, "stdout", long_lines); + cin.exceptions (ios_base::failbit | ios_base::badbit); package_manifest ( @@ -130,7 +137,19 @@ main (int argc, char* argv[]) } else { - assert (argc == 2); + bool long_lines (false); + + for (int i (2); i != argc; ++i) + { + string o (argv[i]); + + if (o == "-l") + long_lines = true; + else + assert (false); + } + + manifest_serializer s (cout, "stdout", long_lines); cin.exceptions (ios_base::failbit | ios_base::badbit); |