Options
Options hold settings for filtering, validation, export behavior, and code generation.
| Category | Description | |
|---|---|---|
| Filtering Options | Give each run of a subcommand (enum, export, struct) its own view of the input data |
View |
| Validation Options | Verify field values against configured constraints during data export to prevent invalid data | View |
| Other Options | Cover options outside the filtering and validation groups | View |
Where Options Are Defined
Section titled “Where Options Are Defined”Options can be defined in:
- Spreadsheets:
- Regular Table: Options row(s)
- Property Sheet: Options column(s)
- Tree-structured data: Meta Nodes (field
options)
In Spreadsheets
Section titled “In Spreadsheets”Syntax
Section titled “Syntax”Each option follows the form:
name=valueThe equals sign (=) separates the name from the value.
Option names are case-insensitive.
| Desc | Player name | Level |
| Name | name | level |
| Type | string | int |
| Options | maxLen=20 | interval=[1,100] |
| 1 | Alice | 10 |
| 2 | Bob | 55 |
If a value contains && or other delimiter characters, it must be quoted:
regexp=`^\d+&&\w+$`whitelist="abc,xyz",foo,barSpecifying Multiple Options
Section titled “Specifying Multiple Options”There are two ways to specify multiple options for a field:
- Single cell: Separate options with
&&. Line breaks between options are allowed for readability but do not act as delimiters. - Additional cells: Add more Options rows (regular table) or Options columns (property sheet). Each cell holds only one option.
| Desc | Player name | Score |
| Name | name | score |
| Type | string | int |
| Options | minLen=2 && maxLen=20 | interval=[0,9999] && nonzero && tags=demo |
| 1 | Alice | 100 |
| 2 | Bob | 250 |
| Desc | Player name | Score |
| Name | name | score |
| Type | string | int |
| Options | minLen=2 | interval=[0,9999] |
| Options | maxLen=20 | nonzero |
| Options | tags=demo | |
| 1 | Alice | 100 |
| 2 | Bob | 250 |
Dedicated Option
Section titled “Dedicated Option”When an option applies to many fields, entering the full name=value pair in every cell is tedious. A dedicated option solves this — in regular tables, label a superheader row as $>xyz, where xyz is the option name, and each cell in that row requires only the option value.
In property sheets, the same mechanism applies but uses columns instead of rows.
| Desc | Name | HP | Server note | Title |
| Name | name | hp | serverNote | title |
| Type | string | int | string | string |
| Options | interval=[0,100) | |||
| $>xflags | c,s | c,s | s | |
| 1 | Warrior | 500 | tank | Guardian |
| 2 | Mage | 300 | dps | Arcane Architect |
Target Modifier
Section titled “Target Modifier”A target modifier is a prefix on the option name. It selects the type-hierarchy layer the option applies to.
| Modifier | Target Layer |
|---|---|
| (none) | Auto-resolved (see below) |
!! |
Basic Type |
>> |
Compact Type |
~~ |
Multi-Column Type |
** |
Subtable Type |
Auto-resolved (no modifier): Archmage determines which layers — Basic Type, Compact Type, or Multi-Column Type — are compatible with the option. If exactly one match is found, the option applies there. If multiple layers match, Archmage asks you to add a modifier to specify the intended layer. Auto-resolution does not reach the Subtable Type layer — use ** to target it explicitly (e.g., **minLen=3).
A layer is targetable only if it contains exactly one candidate. For example, a compact tuple’s sub-fields all belong to the Basic Type layer and therefore constitute multiple candidates. Even with !!, an option cannot be applied to those sub-fields.
| Desc | Categories | Rewards | Skills | ||
| Name | categories | rewards | skills | ||
| Type | >>[]string | >>[]string | []string | ||
| Options | !!minLen=1 | >>maxLen=5 | ~~maxLen=3 | ||
| 1 | epic | sword|shield|bow | slash | thrust | guard |
| 2 | common|daily | potion | bash | ||
Multi-Column Types
Section titled “Multi-Column Types”Each column of a multi-column type may carry identical or different options. Archmage collects them from all columns, deduplicates, and applies each option to its target.
For minmax, vector, tuple, and bitflags, their child-level options are the exception — Archmage resolves them per column instead. For example, the min and max columns of a minmax type can have different validation options.
| Desc | Level range | |
| Name | lvlRange | |
| Type | minmax|int | |
| Options | interval=[1,20] | interval=[50,100] |
| 1 | 5 | 50 |
| 2 | 10 | 70 |
In Tree-Structured Data
Section titled “In Tree-Structured Data”Options appear as the options {...} field inside a Meta Node. Keys define option names; values define their settings, written in the format’s natural key-value syntax.
demo: 1357-88-99demo__meta__: type: string options: regexp: \d{4}-\d{2}-\d{2} tags: demo{ "demo": "1357-88-99", "demo__meta__": { "type": "string", "options": { "regexp": "\\d{4}-\\d{2}-\\d{2}", "tags": "demo" } }}Target modifiers (!!, >>, ~~, **) are not supported here. Each meta node binds to a specific data node, so there is no type-hierarchy ambiguity to resolve.