From 6a06f2c89eaca391ebdda21075db174a3d2e3c6e Mon Sep 17 00:00:00 2001 From: Jason Volk Date: Tue, 18 Sep 2018 04:11:03 -0700 Subject: [PATCH] modules/console: More resource information. --- modules/console.cc | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/modules/console.cc b/modules/console.cc index 1aca60d9f..76079b3b0 100644 --- a/modules/console.cc +++ b/modules/console.cc @@ -3116,7 +3116,25 @@ bool console_cmd__resource(opt &out, const string_view &line) { for(const auto &p : resource::resources) - out << p.first << std::endl; + { + const auto &r(*p.second); + out << '`' << p.first << '\'' + << (r.flags & resource::DIRECTORY? " DIRECTORY" : "") + << std::endl; + + for(const auto &mp : p.second->methods) + { + const auto &m(*mp.second); + out << mp.first + << (m.opts.flags & resource::method::REQUIRES_AUTH? " REQUIRES_AUTH" : "") + << (m.opts.flags & resource::method::RATE_LIMITED? " RATE_LIMITED" : "") + << (m.opts.flags & resource::method::VERIFY_ORIGIN? " VERIFY_ORIGIN" : "") + << (m.opts.flags & resource::method::CONTENT_DISCRETION? " CONTENT_DISCRETION" : "") + << std::endl; + } + + out << std::endl; + } return true; }