diff options
author | Karen Arutyunov <karen@codesynthesis.com> | 2017-04-27 15:11:56 +0300 |
---|---|---|
committer | Karen Arutyunov <karen@codesynthesis.com> | 2017-04-27 15:26:12 +0300 |
commit | dad361a3415e88475a78d1b2702133629fb6e548 (patch) | |
tree | 3d92aa7e87ca5a3dd3a1155f8317d677878182d2 /tests/standard-version/driver.cxx | |
parent | 4b7dfd5a9c0e8f5aeacd14b2e629993550eef2b7 (diff) |
Add standard_version_constraint struct
Diffstat (limited to 'tests/standard-version/driver.cxx')
-rw-r--r-- | tests/standard-version/driver.cxx | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/standard-version/driver.cxx b/tests/standard-version/driver.cxx index 1299090..d301c8c 100644 --- a/tests/standard-version/driver.cxx +++ b/tests/standard-version/driver.cxx @@ -72,11 +72,13 @@ version (const string& s) // argv[0] -a <version> // argv[0] -b <version> // argv[0] -c <version> <version> +// argv[0] -r // argv[0] // // -a output 'y' for alpha-version, 'n' otherwise // -b output 'y' for beta-version, 'n' otherwise // -c output 0 if versions are equal, -1 if the first one is less, 1 otherwise +// -r create version constraints from STDIN lines, and print them to STDOUT // // If no options are specified, then create versions from STDIN lines, and // print them to STDOUT. @@ -117,6 +119,14 @@ try int r (version (argv[2]).compare (version (argv[3]))); cout << r << endl; } + else if (o == "-r") + { + assert (argc == 2); + + string s; + while (getline (cin, s)) + cout << standard_version_constraint (s) << endl; + } else assert (false); |