23 #include "openPMD/Series.hpp" 24 #include "openPMD/helper/list_series.hpp" 39 print_help( std::string
const program_name )
41 std::cout <<
"Usage: " << program_name <<
" openPMD-series\n";
42 std::cout <<
"List information about an openPMD data series.\n\n";
43 std::cout <<
"Options:\n";
44 std::cout <<
" -h, --help display this help and exit\n";
45 std::cout <<
" -v, --version output version information and exit\n";
47 std::cout <<
"Examples:\n";
48 std::cout <<
" " << program_name <<
" ./samples/git-sample/data%T.h5\n";
49 std::cout <<
" " << program_name <<
" ./samples/git-sample/data%08T.h5\n";
50 std::cout <<
" " << program_name <<
" ./samples/serial_write.json\n";
51 std::cout <<
" " << program_name <<
" ./samples/serial_patch.bp\n";
55 print_version( std::string
const program_name )
57 std::cout << program_name <<
" (openPMD-api) " 59 std::cout <<
"Copyright 2017-2020 openPMD contributors\n";
60 std::cout <<
"Authors: Axel Huebl et al.\n";
61 std::cout <<
"License: LGPLv3+\n";
62 std::cout <<
"This is free software: you are free to change and redistribute it.\n" 63 "There is NO WARRANTY, to the extent permitted by law.\n";
72 run( std::vector< std::string >
const & argv )
75 auto const argc = argv.size();
82 for (
int c = 1; c < int(argc); c++) {
83 if (std::string(
"--help") == argv[c] || std::string(
"-h") == argv[c]) {
87 if (std::string(
"--version") == argv[c] || std::string(
"-v") == argv[c]) {
88 print_version(argv[0]);
94 std::cerr <<
"Too many arguments! See: " << argv[0] <<
" --help\n";
104 helper::listSeries(s,
true, std::cout);
106 catch (std::exception
const &e) {
107 std::cerr <<
"An error occurred while opening the specified openPMD series!\n";
108 std::cerr << e.what() << std::endl;
Root level of the openPMD hierarchy.
Definition: Series.hpp:55
std::string getVersion()
Return the version of the openPMD-api library (run-time)
Definition: version.cpp:28
Public definitions of openPMD-api.
Definition: Date.cpp:28
open series as read-only, fails if series is not found