Make all bin/* scripts locate their workflows dynamically
Summary: Ref T2015. Not directly related to Drydock, but I bumped into this. All these scripts currently enumerate their workflows explicitly. Instead, use `PhutilSymbolLoader` to automatically discover workflows. This reduces code duplication and errors (see all the bad `extends` this diff fixes) and lets third parties add new workflows (not clearly valuable?). Test Plan: Ran `bin/x help` for each modified script. Reviewers: btrahan Reviewed By: btrahan CC: aran Maniphest Tasks: T2015 Differential Revision: https://secure.phabricator.com/D7840
This commit is contained in:
@@ -15,16 +15,8 @@ EOSYNOPSIS
|
||||
);
|
||||
$args->parseStandardArguments();
|
||||
|
||||
$workflows = array(
|
||||
new PhabricatorRepositoryManagementPullWorkflow(),
|
||||
new PhabricatorRepositoryManagementDiscoverWorkflow(),
|
||||
new PhabricatorRepositoryManagementEditWorkflow(),
|
||||
new PhabricatorRepositoryManagementListWorkflow(),
|
||||
new PhabricatorRepositoryManagementDeleteWorkflow(),
|
||||
new PhabricatorRepositoryManagementMarkImportedWorkflow(),
|
||||
new PhabricatorRepositoryManagementLookupUsersWorkflow(),
|
||||
new PhabricatorRepositoryManagementImportingWorkflow(),
|
||||
new PhutilHelpArgumentWorkflow(),
|
||||
);
|
||||
|
||||
$workflows = id(new PhutilSymbolLoader())
|
||||
->setAncestorClass('PhabricatorRepositoryManagementWorkflow')
|
||||
->loadObjects();
|
||||
$workflows[] = new PhutilHelpArgumentWorkflow();
|
||||
$args->parseWorkflows($workflows);
|
||||
|
||||
Reference in New Issue
Block a user