<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ??一站式輕松地調用各大LLM模型接口,支持GPT4、智譜、豆包、星火、月之暗面及文生圖、文生視頻 廣告
                # 理解控制臺參數是如何被操作的 要理解 `console` 程序的參數處理方式是比較困難的。`Think Console`,像很多其他的 `CLI` 工具一樣,遵循的是 [docopt](http://docopt.org/) 標準中所描述的行為。 看看下面這個擁有三個選項的命令: ```php <?php namespace app\console; use think\console\Command; use think\console\Output; use think\console\Input; use think\console\input\Option; use think\console\input\Definition; class DemoCommand extends Command { protected function configure() { $this // 命令的名字("think" 后面的部分) ->setName('demo:args') ->setDescription('Describe args behaviors') ->setDefinition( new Definition(array( new Option('foo', 'f'), new Option('bar', 'b', Option::VALUE_REQUIRED), new Option('cat', 'c', Option::VALUE_OPTIONAL), )) ); } protected function execute(Input $input, Output $output) { // ... } } ``` 由于 `foo` 選項并不接收一個值,它將是 `false`(若它未傳入命令)或 `true`(當 `--foo` 被用戶傳入)。`bar` 選項的值(以及它的 `b` 快捷方式)是必填項。它(該值)可以從選項名稱中以 ***空格*** 或 ***=*** 字符給分離出來。`cat` 選項(連同其 `c` 快捷方式)的表現是類似的,但它并非必填項因此不需要一個值。看一眼下面的列表,了解傳入的選項的可能組合方式: |Input|foo|bar|cat| |:----|:---|:---|:---| |--bar=Hello|false|"Hello"|null| |--bar Hello|false|"Hello"|null| |-b=Hello|false|"=Hello"|null| |-b Hello|false|"Hello"|null| |-bHello|false|"Hello"|null| |-fcWorld -b Hello|true|"Hello"|"World"| |-cfWorld -b Hello|false|"Hello"|"fWorld"| |-cbWorld|false|null|"bWorld"| 當命令也接收一個可選參數時,事情變得更加復雜: ```php // ... new Definition(array( // ... new Argument('arg', Argument::OPTIONAL), )); ``` 你可能已經使用了特殊的 -- 分隔符來從參數中分離出選項。看一看下面列表中的第五行,這種用法告訴命令:`World` 是 `arg` 參數的值,而不是可選的 cat 選項的值: |Input|bar|cat|arg| |:----|:---|:---|:---| |--bar Hello|"Hello"|null|null| |--bar Hello World|"Hello"|null|"World"| |--bar "Hello World"|"Hello World"|null|null| |--bar Hello --cat World|"Hello"|"World"|null| |--bar Hello --cat -- World|"Hello"|null|"World"| |-b Hello -c World|"Hello"|"World"|null|
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看