src/Console/Completion/ZshGenerator.php
public function commandmetaCallbackFunction(CommandInterface $cmd)
    {
        $cmdSignature = $cmd->getSignature();


        $buf = new Buffer;
        $buf->indent();

        $buf->appendLine("local curcontext=\$curcontext state line ret=1");
        $buf->appendLine("declare -A opt_args");
        $buf->appendLine("declare -A values");
        $buf->appendLine("local ret=1");

        /*
        values=$(example/demo meta commit arg 1 valid-values)
        _values "description" ${=values} && ret=0
        return ret
        */
        $buf->appendLine("local desc=\$1");
        $buf->appendLine("local valtype=\$3");
        $buf->appendLine("local pos=\$4");
        $buf->appendLine("local completion=\$5");

        $metaCommand = [$this->programName, 'meta', $cmdSignature, '$valtype', '$pos', '$completion'];
        $buf->appendLine('$(' . implode(" ", $metaCommand) . ')');
        $buf->appendLine('_values $desc ${=values} && ret=0'); // expand value array as arguments
        $buf->appendLine('return ret');

        $funcName = $this->commandFunctionName($cmdSignature);

        return $this->compFunction($funcName, $buf);
    }
public function commandmetaCallbackFunction(CommandInterface $cmd)
    {
        $cmdSignature = $cmd->getSignature();


        $buf = new Buffer;
        $buf->indent();

        $buf->appendLine("local curcontext=\$curcontext state line ret=1");
        $buf->appendLine("declare -A opt_args");
        $buf->appendLine("declare -A values");
        $buf->appendLine("local ret=1");

        /*
        values=$(example/demo meta commit arg 1 valid-values)
        _values "description" ${=values} && ret=0
        return ret
        */
        $buf->appendLine("local desc=\$1");
        $buf->appendLine("local valtype=\$3");
        $buf->appendLine("local pos=\$4");
        $buf->appendLine("local completion=\$5");

        $metaCommand = [$this->programName, 'meta', $cmdSignature, '$valtype', '$pos', '$completion'];
        $buf->appendLine('$(' . implode(" ", $metaCommand) . ')');
        $buf->appendLine('_values $desc ${=values} && ret=0'); // expand value array as arguments
        $buf->appendLine('return ret');

        $funcName = $this->commandFunctionName($cmdSignature);

        return $this->compFunction($funcName, $buf);
    }
public function commandmetaCallbackFunction ( CommandInterface $ cmd ) { $ cmdSignature = $ cmd -> getSignature ( ) ; $ buf = new Buffer ; $ buf -> indent ( ) ; $ buf -> appendLine ( "local curcontext=\$curcontext state line ret=1" ) ; $ buf -> appendLine ( "declare -A opt_args" ) ; $ buf -> appendLine ( "declare -A values" ) ; $ buf -> appendLine ( "local ret=1" ) ; /*
        values=$(example/demo meta commit arg 1 valid-values)
        _values "description" ${=values} && ret=0
        return ret
        */ $ buf -> appendLine ( "local desc=\$1" ) ; $ buf -> appendLine ( "local valtype=\$3" ) ; $ buf -> appendLine ( "local pos=\$4" ) ; $ buf -> appendLine ( "local completion=\$5" ) ; $ metaCommand = [ $ this -> programName , 'meta' , $ cmdSignature , '$valtype' , '$pos' , '$completion' ] ; $ buf -> appendLine ( '$(' . implode ( " " , $ metaCommand ) . ')' ) ; $ buf -> appendLine ( '_values $desc ${=values} && ret=0' ) ; // expand value array as arguments $ buf -> appendLine ( 'return ret' ) ; $ funcName = $ this -> commandFunctionName ( $ cmdSignature ) ; return $ this -> compFunction ( $ funcName , $ buf ) ; }
Zsh function usage

example/demo meta commit arg 1 valid-values
appName meta sub1.sub2.sub3 opt email valid-values
Zsh function usage