Skip to content

Commit bff8961

Browse files
#52: Simplify code to automatically set the label separator.
1 parent f94f3c3 commit bff8961

File tree

1 file changed

+6
-11
lines changed

1 file changed

+6
-11
lines changed

includes/drush.inc

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1197,17 +1197,12 @@ function drush_preflight_command_dispatch() {
11971197
// name will be consistant.
11981198
$format = drush_get_option('format', FALSE);
11991199
if ($format) {
1200-
$implemented = drush_get_commands();
1201-
if (array_key_exists($command_name, $implemented)) {
1202-
$command = $implemented[$command_name];
1203-
if ($command) {
1204-
$result = drush_load_command_engines($command);
1205-
$formatter = drush_get_outputformat();
1206-
if (!array_key_exists('label-separator', $multi_options)) {
1207-
$list_separator = $formatter->get_info('list-separator');
1208-
if ($list_separator) {
1209-
$multi_options['label-separator'] = $list_separator;
1210-
}
1200+
if (!array_key_exists('label-separator', $multi_options)) {
1201+
$formatter = drush_load_engine('outputformat', $format);
1202+
if ($formatter) {
1203+
$list_separator = $formatter->get_info('list-separator');
1204+
if ($list_separator) {
1205+
$multi_options['label-separator'] = $list_separator;
12111206
}
12121207
}
12131208
}

0 commit comments

Comments
 (0)