@@ -161,29 +161,29 @@ public function indexNodeCommand(string $identifier, string $workspace = null, s
161161 $ node = $ context ->getNodeByIdentifier ($ identifier );
162162
163163 if ($ node === null ) {
164- $ this ->outputLine ('<error>Error: Node with the given identifier was not found.</error> ' );
165- $ this ->quit (1 );
164+ return [$ workspace ->getName (), '- ' , json_encode ($ dimensions ), 'not found ' ];
166165 }
167166
168- $ this ->outputLine ();
169- $ this ->outputLine ('Indexing node <b>"%s"</b> (%s) ' , [$ node ->getLabel (), $ node ->getIdentifier (),]);
170- $ this ->outputLine (' Workspace: %s ' , [$ workspace ->getName ()]);
171- $ this ->outputLine (' Node type: %s ' , [$ node ->getNodeType ()->getName ()]);
172- $ this ->outputLine (' Dimensions: %s ' , [json_encode ($ dimensions )]);
173-
174167 $ this ->nodeIndexer ->setDimensions ($ dimensions );
175168 $ this ->nodeIndexer ->indexNode ($ node );
169+
170+ return [$ workspace ->getName (), $ node ->getNodeType ()->getName (), json_encode ($ dimensions ), '<success>indexed</success> ' ];
176171 };
177172
178173 $ indexInWorkspace = function ($ identifier , Workspace $ workspace ) use ($ indexNode ) {
179174 $ combinations = $ this ->contentDimensionCombinator ->getAllAllowedCombinations ();
175+
176+ $ results = [];
177+
180178 if ($ combinations === []) {
181- $ indexNode ($ identifier , $ workspace , []);
179+ $ results [] = $ indexNode ($ identifier , $ workspace , []);
182180 } else {
183181 foreach ($ combinations as $ combination ) {
184- $ indexNode ($ identifier , $ workspace , $ combination );
182+ $ results [] = $ indexNode ($ identifier , $ workspace , $ combination );
185183 }
186184 }
185+
186+ $ this ->output ->outputTable ($ results , ['Workspace ' , 'NodeType ' , 'Dimensions ' , 'State ' ]);
187187 };
188188
189189 if ($ workspace === null ) {
0 commit comments