Fixed #19973 -- Replaced optparse by argparse in management commands

`add_arguments` on `DiscoverRunning` is indeed a classmethod, because when we call it, we don't have any test runner instance yet.