public function formatCommand($info) {
    // Create the base.
    $parts = ["drush"];
    $parts[] = $info['alias'];

    // Check for a '--yes' options and set it early for common formatting.
    if (isset($info['options']['yes'])) {
      $parts[] = '-y';
      unset($info['options']['yes']);
    }

    // Add the command name.
    $parts[] = $info['name'];

    // Add arguments.
    if (!empty($info['args'])) {
      $parts[] = implode(' ', $info['args']);
    }

    // Add options.
    if (!empty($info['options'])) {
      // Skip the config option.
      unset($info['options']['config']);

      foreach ($info['options'] as $option => $value) {
        $part = "--{$option}";
        if ($value !== TRUE && $value !== 1) {
          $part .= "={$value}";
        }

        $parts[] = $part;
      }
    }

    return implode(' ', $parts);
  }
public function formatCommand($info) {
    // Create the base.
    $parts = ["drush"];
    $parts[] = $info['alias'];

    // Check for a '--yes' options and set it early for common formatting.
    if (isset($info['options']['yes'])) {
      $parts[] = '-y';
      unset($info['options']['yes']);
    }

    // Add the command name.
    $parts[] = $info['name'];

    // Add arguments.
    if (!empty($info['args'])) {
      $parts[] = implode(' ', $info['args']);
    }

    // Add options.
    if (!empty($info['options'])) {
      // Skip the config option.
      unset($info['options']['config']);

      foreach ($info['options'] as $option => $value) {
        $part = "--{$option}";
        if ($value !== TRUE && $value !== 1) {
          $part .= "={$value}";
        }

        $parts[] = $part;
      }
    }

    return implode(' ', $parts);
  }
public function formatCommand ( $ info ) { // Create the base. $ parts = [ "drush" ] ; $ parts [ ] = $ info [ 'alias' ] ; // Check for a '--yes' options and set it early for common formatting. if ( isset ( $ info [ 'options' ] [ 'yes' ] ) ) { $ parts [ ] = '-y' ; unset ( $ info [ 'options' ] [ 'yes' ] ) ; } // Add the command name. $ parts [ ] = $ info [ 'name' ] ; // Add arguments. if ( ! empty ( $ info [ 'args' ] ) ) { $ parts [ ] = implode ( ' ' , $ info [ 'args' ] ) ; } // Add options. if ( ! empty ( $ info [ 'options' ] ) ) { // Skip the config option. unset ( $ info [ 'options' ] [ 'config' ] ) ; foreach ( $ info [ 'options' ] as $ option => $ value ) { $ part = "--{$option}" ; if ( $ value !== TRUE && $ value !== 1 ) { $ part .= "={$value}" ; } $ parts [ ] = $ part ; } } return implode ( ' ' , $ parts ) ; }
Format a command as a single line.

@param array|null $info
The command settings.

@return string
The formatted command.
Format a command as a single line .