protected function sanitizeCommandArgument($key, $value)
    {
        $key  = ltrim($key, '-');
        if (strlen($key) == 1 || is_numeric($key)) {
            $arg = sprintf('-%s', escapeshellarg($key));
            if ($value !== null) {
                $arg    .= ' '.escapeshellarg($value);
            }
        } else {
            $arg = sprintf('--%s', escapeshellarg($key));
            if ($value !== null) {
                $arg    .= '='.escapeshellarg($value);
            }
        }
        return $arg;
    }
protected function sanitizeCommandArgument($key, $value)
    {
        $key  = ltrim($key, '-');
        if (strlen($key) == 1 || is_numeric($key)) {
            $arg = sprintf('-%s', escapeshellarg($key));
            if ($value !== null) {
                $arg    .= ' '.escapeshellarg($value);
            }
        } else {
            $arg = sprintf('--%s', escapeshellarg($key));
            if ($value !== null) {
                $arg    .= '='.escapeshellarg($value);
            }
        }
        return $arg;
    }
protected function sanitizeCommandArgument ( $ key , $ value ) { $ key = ltrim ( $ key , '-' ) ; if ( strlen ( $ key ) == 1 || is_numeric ( $ key ) ) { $ arg = sprintf ( '-%s' , escapeshellarg ( $ key ) ) ; if ( $ value !== null ) { $ arg .= ' ' . escapeshellarg ( $ value ) ; } } else { $ arg = sprintf ( '--%s' , escapeshellarg ( $ key ) ) ; if ( $ value !== null ) { $ arg .= '=' . escapeshellarg ( $ value ) ; } } return $ arg ; }
Sanitizes a command line argument

@param   string      $key        The argument key
@param   string      $value      The argument value (can be empty)
@return  string
Sanitizes a command line argument