-
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathcwl_input_example_store_config.cpp
More file actions
34 lines (28 loc) · 941 Bytes
/
cwl_input_example_store_config.cpp
File metadata and controls
34 lines (28 loc) · 941 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#include "cwl_v1_2.h"
#include <iostream>
/**
* This test program creates loads and prints a CWL description.
*
* It assumes that printing to stdout works (see cwl_output_example).
* It loads a CWL description from a file and populates C++ classes.
*/
// using shortened cwl:: namespace instead of w3id_org::cwl
namespace cwl = w3id_org::cwl;
int main(int argc, char** argv) {
if (argc < 2) return 1;
auto tool = cwl::load_document(argv[1]);
// parse command line
auto config = cwl::store_config{};
for (int i{2}; i < argc; ++i) {
auto sv = std::string_view{argv[i]};
if (sv == "no_simplification") {
config.simplifyTypes = false;
} else if (sv == "no_list_to_map") {
config.transformListsToMaps = false;
} else if (sv == "tags") {
config.generateTags = true;
}
}
cwl::store_document(tool, std::cout, config);
return 0;
}