Commit bb07675e authored by Michael Davis's avatar Michael Davis
Browse files

[cta-frontend] Removes hard-coding of client username in debug mode

parent b5c75d30
......@@ -290,17 +290,15 @@ void CtaAdminCmd::throwUsage(const std::string &error_txt) const
{
// Command has been set: show command-specific help
help << m_execname << ' ';
// Reverse lookup of subcommand
// Reverse lookup of long command name
std::string longcmd;
for(auto map_it = cmdLookup.begin(); map_it != cmdLookup.end(); ++map_it) {
if(admincmd == map_it->second) {
help << map_it->first << ' ';
break;
if(admincmd == map_it->second && map_it->first.length() > longcmd.length()) {
longcmd = map_it->first;
}
}
help << cmdHelp.at(admincmd).help();
help << m_execname << ' ' << longcmd << cmdHelp.at(admincmd).help();
}
throw std::runtime_error(help.str());
......
......@@ -87,8 +87,6 @@ public:
<< (resource.rOpts & XrdSsiResource::Reusable ? "Resuable " : "")
<< (resource.rOpts & XrdSsiResource::Discard ? "Discard" : "")
<< std::endl;
resource.client->name = "ctadev";
#endif
if(resource.client == nullptr || resource.client->name == nullptr)
{
......@@ -97,6 +95,10 @@ public:
return false;
}
#ifdef XRDSSI_DEBUG
std::cerr << "[DEBUG] Resource client name: " << resource.client->name << std::endl;
#endif
return true;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment