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