23 int usage(
const std::string& command_name,
int exit_code );
30 std::string conditions;
45 std::string configName(
arg.hconfig );
46 TFile*
config = TFile::Open( configName.c_str() );
48 std::cerr <<
"Cannot open file \"" << configName <<
"\"\n";
52 TKey*
key =
config->FindKey(
"HanMetadata");
54 std::cout <<
"Metadata:\n";
55 TDirectory* metadatadir =
dynamic_cast<TDirectory*
>(
key->ReadObj());
57 std::cerr <<
"Metadata directory is malformed\n";
61 TIter
next(metadatadir->GetListOfKeys());
62 while ((mdkey =
dynamic_cast<TKey*
>(
next()))) {
63 metadatadir->GetObject(mdkey->GetName(), hcm);
65 std::cout << *hcm << std::endl;
73 std::cerr <<
"Cannot find configuration in file \"" << configName <<
"\"\n";
79 std::cerr <<
"Cannot find configuration in file \"" << configName <<
"\"\n";
106 int usage(
const std::string& command_name,
int exit_code )
110 message +=
"This program takes as an argument the name of a \'han\' configuration\n";
111 message +=
"file and prints the configuration.\n";
113 std::string::size_type
s = command_name.size();
114 std::string::size_type
p = command_name.rfind(
'/',
s );
115 std::string short_name = command_name.substr(
p+1,
s );
118 std::cout <<
"Usage: " << short_name <<
" <filename>\n";