src/Console/Completion/ZshGenerator.php
public function command_args_case(CommandInterface $cmd)
    {
        $buf = new Buffer;
        $buf->appendLine('case $state in');

        foreach ($cmd->getArguments() as $a) {
            $buf->appendLine("({$a->name})");

            if ($a->validValues || $a->suggestions) {
                $buf->appendLine('_values ' . $this->render_argument_completion_values($a) . ' && ret=0');
            } elseif (in_array($a->isa, ['file', 'path', 'dir'], true)) {
                $buf->appendLine($this->render_argument_completion_handler($a) . ' && ret=0');
            }
            $buf->appendLine(';;');
        }
        $buf->appendLine('esac');

        return $buf->__toString();
    }
public function command_args_case(CommandInterface $cmd)
    {
        $buf = new Buffer;
        $buf->appendLine('case $state in');

        foreach ($cmd->getArguments() as $a) {
            $buf->appendLine("({$a->name})");

            if ($a->validValues || $a->suggestions) {
                $buf->appendLine('_values ' . $this->render_argument_completion_values($a) . ' && ret=0');
            } elseif (in_array($a->isa, ['file', 'path', 'dir'], true)) {
                $buf->appendLine($this->render_argument_completion_handler($a) . ' && ret=0');
            }
            $buf->appendLine(';;');
        }
        $buf->appendLine('esac');

        return $buf->__toString();
    }
public function command_args_case ( CommandInterface $ cmd ) { $ buf = new Buffer ; $ buf -> appendLine ( 'case $state in' ) ; foreach ( $ cmd -> getArguments ( ) as $ a ) { $ buf -> appendLine ( "({$a->name})" ) ; if ( $ a -> validValues || $ a -> suggestions ) { $ buf -> appendLine ( '_values ' . $ this -> render_argument_completion_values ( $ a ) . ' && ret=0' ) ; } elseif ( in_array ( $ a -> isa , [ 'file' , 'path' , 'dir' ] , true ) ) { $ buf -> appendLine ( $ this -> render_argument_completion_handler ( $ a ) . ' && ret=0' ) ; } $ buf -> appendLine ( ';;' ) ; } $ buf -> appendLine ( 'esac' ) ; return $ buf -> __toString ( ) ; }
complete argument cases
complete argument cases