Removes the need to pass cmd as an argument to Run(). This change required reading the --sort-by flag in Complete() in a way similar to other flags.
This change allows the cobra.Command not to need to be passed throughout the completion code, which I updated as part of this commit.
It also is a step in the direction of the TODO comment requesting the removal of arguments passed to Run() and watch().
Kubernetes-commit: aa7a828f20b479a8a943d897224e8e76c3bb6cff
This PR changes `kubectl apiresources` command by using restclientgetter
instead of cmdutil.Factory for loose coupling and a couple of minor refactorings.
This PR also unleashes migration of other commands depending on apiresources
via completion.
Kubernetes-commit: 50c93bfe04557eccb38b46cc4b99a6a3ec13f85b