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;
    }