> For the complete documentation index, see [llms.txt](https://chaoses-ib.gitbook.io/directory-opus/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://chaoses-ib.gitbook.io/directory-opus/guan-fang-shou-ce/readme.zh-10/readme.zh-3/readme.zh/args.zh.md).

# Args

**Args** 对象在脚本通过命令行调用时，或通过 [**Func**](/directory-opus/guan-fang-shou-ce/readme.zh-10/readme.zh-3/readme.zh/func.zh.md)**.args** 属性被传递给脚本。当脚本添加的命令拥有 [命令行模板](/directory-opus/guan-fang-shou-ce/readme.zh-10/readme.zh-2/argument_types.zh.md) 时，它用于访问命令行上提供的任何参数。

| 属性名称         | 返回类型      | 描述                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| ------------ | --------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| *<参数名称>*     | *variant* | <p><strong>Args</strong> 对象将拥有与命令行模板中的每个参数相对应的属性。</p><p>例如，如果命令行模板是 <strong>NAME/K,SIZE/N</strong>，<strong>Args</strong> 对象将拥有两个属性，名为 <strong>name</strong> 和 <strong>size</strong>。</p><p>每个属性返回的类型也由模板定义。在上面的例子中，<strong>name</strong> 将返回一个 <em>string</em>，而 <strong>size</strong> 将返回一个 <em>int</em>。<br><strong>/S</strong> 参数返回一个 <em>bool</em>，<strong>/N</strong> 参数返回一个 <em>int</em>，所有其它参数类型返回一个 <em>string</em>。请注意，<strong>/O</strong> 参数如果命令行上没有提供字符串值，也将返回一个 <em>bool</em>。<br>如果模板中标记了一个参数为 <strong>/M</strong>（多个），则它将返回一个包含适当类型元素的 <a href="/pages/eVUEPeqBMSfDkhV44apF"><strong>Vector</strong></a>。</p><p>如果用户在命令行上没有提供某个参数，则它的属性将返回 <em>bool</em>（对于 <strong>/S</strong> 或 <strong>/O</strong> 参数），或者返回一个空变体。</p> |
| **got\_arg** | *object*  | **got\_arg** 属性返回一个对象，该对象对模板中的每个参数都有一个 *bool* 子属性。它允许您在实际查询参数的值之前，测试某个特定参数是否在命令行上提供。例如，***If Args.got\_arg.size Then...***                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
