Unregister commands made private after the fact.
Unregister commands made private after the fact.

Commands are registered on method_added, but when a method is made private after defined, there's no way to tell that happened.

(Trust me. Ruby has no hook for visibility change and overriding Module.private breaks it for calls with no args.)

So once all commands are loaded we scan for commands whose methods that have turned private and remove them.

Sudo uses aliasing extensively and was leaking a bunch of methods as invalid commands.

duypq94/heroku,vcgato29/heroku,macedo/heroku,rkh/heroku,heroku/heroku,greeca0204/heroku,heroku/heroku,vcgato29/heroku,rkh/heroku,vcgato29/heroku,greeca0204/heroku,gregburek/heroku,heroku/heroku,gregburek/heroku,greeca0204/heroku,sancopanco/heroku,gregburek/heroku,duypq94/heroku,Faisalawanisee/heroku,Faisalawanisee/heroku,sancopanco/heroku,macedo/heroku,Faisalawanisee/heroku,sancopanco/heroku,dickeyxxx/heroku,duypq94/heroku,macedo/heroku,dickeyxxx/heroku,rkh/heroku,dickeyxxx/heroku