mDescription = 'Expands a message group specification.'; $this->addOption( 'exportable', 'List only groups that can be exported', false, /*required*/ false /*has arg*/ ); $this->addArg( 'specification', 'For example page-*,main', true, /*required*/ false /*has arg*/ ); } public function execute() { $spec = $this->getArg( 0 ); $patterns = explode( ',', trim( $spec ) ); $ids = MessageGroups::expandWildcards( $patterns ); if ( $this->getOption( 'exportable' ) ) { foreach ( $ids as $index => $id ) { if ( !MessageGroups::getGroup( $id ) instanceof FileBasedMessageGroup ) { unset( $ids[ $index ] ); } } } if ( $ids !== [] ) { // This should not be affected by --quiet echo implode( "\n", $ids ) . "\n"; } } } $maintClass = TranslateExpandGroupSpec::class; require_once RUN_MAINTENANCE_IF_MAIN;