File tree 1 file changed +17
-0
lines changed
1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change
1
+ #include < cstdlib>
2
+ #include < cstring>
1
3
#include < openPMD/auxiliary/JSON_internal.hpp>
2
4
3
5
#include < iostream>
@@ -39,6 +41,21 @@ int main(int argc, char const **argv)
39
41
std::cin >> jsonOrToml;
40
42
break ;
41
43
case 2 :
44
+ if (strcmp (argv[1 ], " --help" ) == 0 || strcmp (argv[1 ], " -h" ) == 0 )
45
+ {
46
+ std::cout << " Usage: " << std::string (argv[0 ]) << R"( [json_or_toml]
47
+ 'json_or_toml' can be a JSON or TOML dataset specified inline or a reference
48
+ to a file prepended by an '@'.
49
+ Inline datasets will be interpreted as JSON if they start with an '{', as TOML
50
+ otherwise. Datasets from a file will be interpreted as JSON or TOML depending
51
+ on the file ending '.json' or '.toml' respectively.
52
+ Inline dataset specifications can be replaced by input read from stdin.
53
+
54
+ If the input is JSON, then it will be converted to TOML and written to stdout,
55
+ equivalently from TOML to JSON.
56
+ )" ;
57
+ exit (0 );
58
+ }
42
59
jsonOrToml = argv[1 ];
43
60
break ;
44
61
default :
You can’t perform that action at this time.
0 commit comments