public function getBuiltCommand()
    {
        $cmd = $this->command;

        foreach ($this->arguments as $argument) {
            $os = $argument->getOs();

            if ($os && !($os & $this->os->getType())) {
                continue;
            }

            $key = $argument->getKey();
            $prefix = $argument->getPrefix();

            if ($argument->willEscape() === true || ($argument->willEscape() === null && ($this->flags & ESCAPE))) {
                $key = $this->escapeshellarg($key);
            }
            $key = $prefix.$key;

            $values = $argument->getValues();

            if (empty($values)) {
                $cmd .= " $key";
                continue;
            }

            foreach ($values as $val) {
                $cmd .= " $key";
                $cmd .= ($this->flags & DONT_ADD_SPACE_BEFORE_VALUE) ? '' : ' ';
                if ($argument->willEscape() === true || ($argument->willEscape() === null && ($this->flags & ESCAPE))) {
                    $val = $this->escapeshellarg($val);
                }
                $cmd .= $val;
            }
        }

        return trim($cmd);
    }